Short answer: yes, it can be done. Unfortunately, I don't know how to do it without shelling to ILDASM behind the scenes.
Long answer: If you view your assembly in ILDASM, you'll see which classes actually implement an interface. (You can also use the Object Browser and open up the 'Bases and Interfaces' tree.) So, the question we're left with is: how do we do it at run-time without having to resort to calling ILDASM and collecting its output? Has someone written an IL reader class that can be used to dump class definitions? (Lutz Roeder's ILReader library only gets the IL for a method). -Andy Hopper http://hoppersoft.com/Andy ----- Original Message ----- From: "Thomas Tomiczek" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 25, 2003 9:44 AM Subject: [ADVANCED-DOTNET] Type class - finding out whether a specific interface is iplemented in the type on THIS inheritance level... Possible? I have an inheritance hierarchy like this: As, implements I A Bs, implements I B Cs, implements I C Given a Type T, is there any way for me to find out whether the given type has the implements clause explicitly given? Means, is As, Bs or Cs? Or is I available everywhere starting from As down and this information is not accessible anymore? Regards Thomas Tomiczek THONA Consulting Ltd. (Microsoft MVP C#/.NET)
