Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding all the classes that inherit an interface in Visual Studio [duplicate]

If I find out about a new interface, does Visual Studio provide any means to find out all the classes that have inherited that interface?

No,I don't want the C# code to do that..I know that's available at stackoverflow itself.I just want to know if Visual Studio has any functionality to find out this info for any interface through intellisense or any shortcut??

like image 392
Josh Avatar asked Dec 13 '09 16:12

Josh


People also ask

How do I get class hierarchy in Visual Studio?

As an option for those using Visual Assist, you can also press Shift + ALT + G (while the caret is on the class name) to bring up the "Goto Related" context menu, and if there are derived classes you will get a submenu for that that lists them all out and even shows inheritance structures among those derived classes.

Can an interface inherit multiple interfaces in C#?

An interface may inherit from multiple base interfaces, and a class or struct may implement multiple interfaces.

Is interface inherited?

Interfaces can inherit from one or more interfaces. The derived interface inherits the members from its base interfaces. A class that implements a derived interface must implement all members in the derived interface, including all members of the derived interface's base interfaces.


3 Answers

Actually, VS can do it.

Go to the Object Browser, select .Net Framework vX, then navigate to an interface and expand Derived Types.

In VS2010, this feature is available in all views, but in earlier versions, it's only available in a complete framework list.

As other people have noted, Reflector can also do this, and, unlike Resharper, it is free.

like image 149
SLaks Avatar answered Sep 21 '22 13:09

SLaks


Visual Studio does not have this functionality. Resharper does. I think the closest you can get is right click on the interface and select Find All References.

like image 39
Darin Dimitrov Avatar answered Sep 20 '22 13:09

Darin Dimitrov


Reflector does, it is free and excellent. Search for the interface name and expand the "Derived Types" node.

like image 40
Hans Passant Avatar answered Sep 22 '22 13:09

Hans Passant