In Visual Studio, when you right-click a method call, you go to the implementation of that method inside a class except if you access this method through an interface: in th
Depending on the version of Visual Studio that you have, I'll say conditionally "yes."
I'm currently operating on Ultimate, and don't have other versions to verify this. That said, within Ultimate, you can use the Architecture Explorer to find implementations. It's a little more involved than the right click method, but here's how it works.
View->Architecture Explorer
(or CTRL-W, N)Types
. Click thisInterfaces
Members
will then appear to the right. Click that buttonImplemented by
(under Inbound Navigation
) and that will provide a list of implementations of your interface.Within 2012 Ultimate, you can search the interface in solution explorer. Right-click the interface and choose "Derived Types", the implemented classes will shown in solution explorer. Not sure if it works in express.
I do the following:
1) Right click on the method and click "View call hierarchy" (or shortcut Ctrl+K, Ctrl+T)
2) Expand the "Implements x" folder which will then show you all the implementations of that method. Click on one to go there.
Relatively quick and easy. Annoyingly though there doesn't seem to be an equivalent for the interface itself.
update: as of Visual Studio 2015 update 1, right click on a method and select go to implementation. You can also map it to keyboard shortcut via Tools > Options > Environment > Keyboard and search for Edit.GoToImplementation command. The default shortcut is Ctrl+F12
. (F12
will navigate to the interface).
I created a free extension for Visual Studio 2010 and Visual Studio 2012 called Inheritance Margin to provide this specific feature, as well as give a clear indication when a method implements an interface method due to a signature match. In the current version, you can right click on any glyph to get a menu of items to navigate to.
Inheritance Margin - Visual Studio Gallery
(source: microsoft.com)
For people who use Resharper, pressing CTRL + F12 will make you go directly to the class method!
Visual Studio can only tell you where it is referenced, but this may be too coarse.
There are other tools that can tell you more about the structure of your application, including which class implements which interface, which method overrules which other method, and so on. I personally prefer using Understand For C/C++.