On Aug 21, 12:53*pm, Marc Gravell <marc.grav...@gmail.comwrote:
For classes, you can use:
type1.IsSubclassOf(type2)
If you mean interfaces, this i slightly tricker - but IsAssignableFrom
might do the job.
Note that IsSubclassOf will return false if type1==type2 (which is
expected, given its name, but may be surprising in a sense that this
behavior is different from the "is" operator).
The most generic way to do this, which will handle the case described
above, as well as interfaces, is indeed Type.IsAssignableFrom.