introspection - In C# what is the equivalent of "is" keyword but using Type objects -
I think that's a simple question, but in the type class document, they only talk about the interface on the GetInterfaces method.
i.e. Typeof (ChildClass) .XXX (ParentClass)
This is your Depending on what needs; IsAssignableFrom, probably:
bool stringIsObj = typeof (object) .IsAssignableFrom (typeof (string));
or < Code> IsSubclassOf :
bool stringIsObj = typeof (string) .isSubclassOf (typeof (object));
Comments
Post a Comment