简体   繁体   English

在Visual Studio 2010中查找C#解决方案的常用方法名称的所有引用

[英]Finding all references of a common method name in Visual Studio 2010 for a C# solution

In Visual Studio 2010, if I right-click a method and choose "Find All References", it simply displays use of all methods with the same name rather than use of the method of that actual class. 在Visual Studio 2010中,如果我右键单击某个方法并选择“查找所有引用”,它只显示使用具有相同名称的所有方法,而不是使用该实际类的方法。

The solution is C# rather than C++, so I can't find a way to switch to accuracy mode . 解决方案是C#而不是C ++,所以我找不到切换到精确模式的方法 Also, I cannot simply make the method private or comment it out to generate errors as the method is an override : 此外,我不能简单地将该方法设为私有或注释掉它以生成错误,因为该方法是一个override

public override string ToString() { ... }

Is there any way of finding all uses of a particular class method in a solution without trawling through every single name match (in this case every instance of ToString() in the solution)? 是否有任何方法可以在解决方案中找到特定类方法的所有用法而无需遍历每个单一的名称匹配(在这种情况下,解决方案中的每个ToString()实例)?

使用丹尼尔Hilgarth的评论我找到了解决办法:暂时删除override从声明,它会显示该班仅引用ToString()而不是ToString()的所有object的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM