I have a class that looks something like this:
public class Parent
{
public class Subclass
{
}
}
and using reflection I'm trying to find a subclass
void main
{
Parent p = new Parent();
Type t = p.GetType();
Type s = t.GetNestedType("Subclass");
}
This does not work, because there are apparently no nested types. How to find the type of subclass? The reason I need to get s is to then call .GetMethod ("someMethod"). Call (...) on it.
source
share