简体   繁体   English

在Visual Studio 2015中查找方法调用

[英]Find method calls in Visual Studio 2015

is there a function or VS-Extension to find all method calls in c# code? 是否有函数或VS-Extension来查找c#代码中的所有方法调用?

For example, i have a bitmap object which calls in some function myBitmap.Save(stream, ImageFormat.Gif) . 例如,我有一个位图对象,该对象调用某些函数myBitmap.Save(stream, ImageFormat.Gif) My goal is to find all .Save calls from Bitmap-Type in my code. 我的目标是在我的代码中找到所有来自Bitmap-Type的.Save调用。 I hope everybody understand my question. 我希望每个人都能理解我的问题。

I know, that i could use Find and Replace and search for " .Save( ". But this also returns XmlDocument.Save() and other " .Save( " calls. This is not what i want. I want only .Save calls to the Bitmap-Type. 我知道,我可以使用“查找和替换”并搜索“ .Save( ”。但这也会returns XmlDocument.Save()和其他“ .Save( ”调用。这不是我想要的。我只想要.Save调用到位图类型。

Visual Studio has options to search for various objects . Visual Studio具有用于搜索各种对象的选项。 What you have described (find all members of certain type) is called Find all references . 您所描述的(查找特定类型的所有成员)称为查找所有引用

Simply right click on the method name (in the text editor, object browser, class viewer, etc.) and you should see context menu with such option: 只需右键单击方法名称(在文本编辑器,对象浏览器,类查看器等中),您将看到带有以下选项的上下文菜单:

Using this option will brings up Find Symbols Results window with matches: 使用此选项将打开带有匹配项的“ 查找符号结果”窗口:

PS: screenshots are taken from the google image search for an overview and may not necessarily match VS version or the case. PS:屏幕快照取自Google图像搜索的概述,可能不一定与VS版本或大小写匹配。

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

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