Which classes implement an interface? 
Author Message
 Which classes implement an interface?

I have created a public interface and several classes that implement that
interface.

If I have a .dll that contains these classes plus OTHER classes that DO NOT
implement the interface, how can I, with only the filename of the .DLL
determine the names of the classes that implement the interface?

I want to take the name of an Assembly .dll and get all the classes that
are present and then which of those classes implement the interface.

Thanks,

Chris

--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail



Sun, 29 May 2005 06:30:12 GMT  
 Which classes implement an interface?


To answer my own question:

Use System.Reflection.Assembly.GetTypes to get a list of types from the
assembly.  Then with a specific type, use Type.GetInterface("Interface").  
If that call returns nothing, then the interface is not implemented,
otherwise it is.

Hope this helps someone else.

Chris

--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail



Sun, 29 May 2005 23:15:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How can I check if a late-bound class implements an Interface or inherits a defined class

2. Implementing IUnknown interface in Access 2000 class

3. Implementing the IEnumerator interface in my custom class

4. Need help Implement a class interface.

5. Identifying classes/components that implements certain interfaces

6. Implementing public interface of another class

7. IMPLEMENTING AN INTERFACE MADE FROM ANOTHER INTERFACE

8. Implementing an interface made from another interface

9. IMPLEMENTING AN INTERFACE MADE FROM ANOTHER INTERFACE

10. Implementing an interface made from another interface

11. Implementing interfaces

12. Cannot implement Interface

 

 
Powered by phpBB® Forum Software