你如何快速找到一个接口的方法的实现(S)? [英] How do you quickly find the implementation(s) of an interface's method?

查看:764
本文介绍了你如何快速找到一个接口的方法的实现(S)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个快速的方法来找到所有的,而不是引用接口的方法/属性/等的实现呢?下面是一些示例code:

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
{
  IBaseClass _someClass;
  private TestMethod()
  {
    _someClass = new SomeClass();
    _someClass.GetInt();
  }
}

我要赶紧去SomeClass.GetInt()在审查SomeOtherClass.TestMethod()。如果我对_someClass.GetInt()点击右键,然后单击转到定义,它带我到的接口。如果我点击查找所有引用,我可能会看到所有的用途清单...不只是实现调用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.

有没有发现这是一个更快的方法?从其他开发者有什么建议?我们使用的是直喷式我们大多数的依赖,这意味着通过深度嵌套code跟踪需要的永久的。

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.

推荐答案

看起来像<一个href=\"http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=333338\">there's希望,至少。(无效链接)

Looks like there's hope, at least. (broken link)

请务必遵循<一个href=\"http://$c$c.msdn.microsoft.com/vslangfutures/Wiki/View.aspx?title=Call%20Hierarchy&referringTitle=Home.\">Future重点:调用层次环节由DJ公园共享

Be sure to follow the Future Focus: Call Hierarchy link shared by DJ Park.

这篇关于你如何快速找到一个接口的方法的实现(S)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆