Interfaces

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.
 
P

Peter Morris

You have far too much spare time on your hands to be able to answer an "x is
y" question in that much depth :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top