❔ Get property from type
Through reflection I get all the types matching the interface.
However, a class has for example:
Is there a way I can get the Name property in the foreach? What i tried didnt work.
10 Replies
Or is it OK to rename the file to 6x6RegularPuzzle?
why are you using reflection?
Since i dynamically need the puzzles. I first had a list with the extensions but that was not good.
This works:
but i activate all the instances
Try this
var nameProperty = type
.GetProperties()
.First(x => x.Name == "Name");
You can get the value from that easily
Sorry for the formatting I'm on my phone
Type names can not begin with numbers
I got static issues when doing that
Why can't you make the method static?
The method?
Sorry it's 8 am and I just woke up
GetRegularTypes function or method, whatever you like to call it. Good morning then
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.