Wednesday, October 18, 2006

HOWTO: Find all classes that implement an interface

So I'm coding along and I run into this nice error:

SideBarList control must contain an IButtonControl with ID SideBarButton in every item template, this maybe include ItemTemplate, EditItemTemplate, SelectedItemTemplate or AlternatingItemTemplate if they exist.

Now the question is. Just how do I find all the classes that implement IButtonControl. Just from memory I know there's the LinkButton and Button. I'd forgotten about ImageButton. I tried googling, both the web and groups. Point is, there's no easy way using either Visual Studio 2005 or the MSDN Library.

Thankfully there's Lutz Roeder's Reflector to the rescue.

How To Find Classes That Implement An Interface

This handy tool will let you see all the classes (classes you have loaded into the tool) that implement the interface either directly or indirectly.

No comments: