Say I have a class like this:
public class Test {
public class InnerTest{}
}
Now have a TypeInfo object for InnerTest. How can I find out the TypeInfo object for Test from InnerTest?
The other way around is simple, I can just use GetNestedTypes(), but I can’t find a method or property (other than IsNestedType) to figure out the containing class for a Nested Class.
You can get this by retrieving the property “DeclaringType”.
Quoting MSDN:
http://msdn.microsoft.com/en-us/library/system.type.declaringtype.aspx