Interfaces

  • Thread starter Thread starter Jay Dee
  • Start date Start date
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.
 
You have far too much spare time on your hands to be able to answer an "x is
y" question in that much depth :-)
 
Back
Top