Value of member of composite class using Reflection
I have a class which compose of multiple other classes.
class X
{
public string str;
}
class Y
{
public X x;
}
Now I know that using reflection you can get the value a direct member of
class Y but my doubt is that whether using reflection, can I get the value
of member of composite class i.e. str? Something like
y.GetType().GetProperty("x.str")
I have also tried y.GetType().GetNestedType("X") but it is giving me null
as output.
No comments:
Post a Comment