[英]Visual Studio Call Hierarchy : How to find calls through an implemented interface to a method?
with Visual Studio Call Hierarchy functionality I can find calls to a certain method. 使用Visual Studio调用层次结构功能,我可以找到对特定方法的调用。
However, it doesn't seem to be able to find class through an implemented interface. 但是,它似乎无法通过已实现的接口查找类。 Like in the following, if
Method()
is called through IFoo, these calls aren't found in the Call Hierarchy? 类似于以下内容,如果通过IFoo调用了
Method()
则在“调用层次结构”中找不到这些调用吗?
interface IFoo
{
void Method();
}
class Foo : IFoo
{
public void Method()
{
// ...
}
}
Is there some way to do this in plain VS or with some free plugin? 有什么方法可以在普通VS中或通过一些免费插件来做到这一点?
Resharper seems to be able to do this (with some problems with more complicated cases) as in C# - Can't find usage of method when inherited and used through an interface implemented by the subclass . Resharper似乎能够做到这一点(在更复杂的情况下会出现一些问题),就像在C#中一样-在通过子类实现的接口继承和使用时找不到方法的用法 。
br, Touko br,Touko
Well, I'd never heard of Call Hierarchy before; 好吧,我以前从未听说过呼叫层次结构; I always use Find Symbol References - Shift + F12 on anything, including method names.
我总是在任何地方使用查找符号引用-Shift + F12 ,包括方法名称。 This picks up calls via interfaces.
这通过接口代答呼叫。
Reshaper has feature called go to implementation . Reshaper具有称为转到实现的功能 。 It allows you to find all classes that implement particular method or interface.
它允许您查找实现特定方法或接口的所有类。
Also it has a find usages . 它还具有查找用法 。 And it is able to search usages from interface or directly from class depending on what you need.
它可以根据需要从界面或直接从类中搜索用法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.