简体   繁体   中英

Find method calls in Visual Studio 2015

is there a function or VS-Extension to find all method calls in c# code?

For example, i have a bitmap object which calls in some function myBitmap.Save(stream, ImageFormat.Gif) . My goal is to find all .Save calls from Bitmap-Type in my code. 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.

Visual Studio has options to search for various objects . 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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