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

Popular posts from this blog

email - PHP mail error ... failed to open stream : permission denied -

sql server - SQL Query - Delete duplicates if more than 3 dups? -

c - Different access levels with PAM -