huckfinn19
Programmer
Hi,
I need to be able to find out if a class is derived from a particular interface.
I know that it is possible to find out if a class is derived from a base class with the System.Type class with the following code:
I need the same thing for interfaces. Does anything exist that does the same kind of job than IsSubclassOf for class inheritance but for interface inheritance?
If not, how could I find out if a class is derived from a particular interface?
Thanks!
Huck
I need to be able to find out if a class is derived from a particular interface.
I know that it is possible to find out if a class is derived from a base class with the System.Type class with the following code:
Code:
public class Class1 {}
public class Class2 : Class1 {}
if(typeof(Class2).IsSubclassOf(typeof(Class1)))
...
I need the same thing for interfaces. Does anything exist that does the same kind of job than IsSubclassOf for class inheritance but for interface inheritance?
If not, how could I find out if a class is derived from a particular interface?
Thanks!
Huck