Visual Studio IDE - how do you quickly find the implementation(s) of an interface's method?

Posted by Jess on Stack Overflow See other posts from Stack Overflow or by Jess
Published on 2009-08-11T16:43:47Z Indexed on 2010/06/09 12:02 UTC
Read the original article Hit count: 203

Is there a quick way to find all of the implementations of, not references to, an interface's method/property/etc? Here's some sample code:

public class SomeClass : IBaseClass
{
  public Int32 GetInt()
  {
     return 1;
  }
}

public interface IBaseClass
{
  public Int32 GetInt();
}

public class SomeOtherClass
{
  ISomeClass _someClass;
  private TestMethod()
  {
    _someClass = new SomeClass();
    _someClass.GetInt();
  }
}

I want to quickly get to SomeClass.GetInt() while reviewing SomeOtherClass.TestMethod(). If I right click on _someClass.GetInt() and click 'Go To Definition', it takes me to the interface. If I click 'Find All References', I could potentially see a list of all uses ... not just the classes that implement the GetInt() method.

Is there a faster way to find this? Any tips from other developers? We are using D.I. for most of our dependencies, which means that tracing through deeply nested code takes forever.

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio