tags:

views:

79

answers:

1

how know if a Type has inherited some other type ?

Type t;
// i get the t from somewhere
bool b = t.IsInhertitedFrom(typeof(BaseType));
+10  A: 

bool b = t.IsSubclassOf(typeof(BaseType))

and to check if type implements interface use:

bool b = t.GetInterface(typeof(IMyInterface).FullName) != null

jarek