J
Jay Dee
I can use code something like this if I want to determine if an object
derives from or is of the given type.
if (this.myObject.GetType() == typeof(MyObjectClass) ||
this.myObject.GetType().IsSubclassOf(typeof(MyObjectClass)))
{
// Do Sothing
}
Douse anyone no of the best way to determine if a class derives from a
given Interface using a similar method as I cannot seem to find a
suitable method within the Type class.
derives from or is of the given type.
if (this.myObject.GetType() == typeof(MyObjectClass) ||
this.myObject.GetType().IsSubclassOf(typeof(MyObjectClass)))
{
// Do Sothing
}
Douse anyone no of the best way to determine if a class derives from a
given Interface using a similar method as I cannot seem to find a
suitable method within the Type class.