Re: knowing the interfaces that an object implements
- From: "LOZANO-MORÁN, Gabriel" <gabriel.lozano@xxxxxxxxxxx>
- Date: Mon, 25 Apr 2005 10:56:39 +0200
To check wether the interface IDisposable is implemented:
if(<object>.GetType().GetInterface("IDisposable") == null)
return false;
else
return true;
To get all interfaces of an object:
Type[] interfaces = <object>.GetType().GetInterfaces();
foreach(Type _interface in interfaces)
{
Console.WriteLine(_interface.Name);
}
Gabriel Lozano-Morán
.
- Follow-Ups:
- Re: knowing the interfaces that an object implements
- From: Jakob Christensen
- Re: knowing the interfaces that an object implements
- References:
- knowing the interfaces that an object implements
- From: Sanjay
- knowing the interfaces that an object implements
- Prev by Date: knowing the interfaces that an object implements
- Next by Date: Re: knowing the interfaces that an object implements
- Previous by thread: knowing the interfaces that an object implements
- Next by thread: Re: knowing the interfaces that an object implements
- Index(es):