Saftpresse99
Saftpresse99

Reputation: 979

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.

Upvotes: 0

Views: 680

Answers (1)

Sinatr
Sinatr

Reputation: 22008

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:

P.S.: screenshots are taken from the google image search for an overview and may not necessarily match VS version or the case.

Upvotes: 1

Related Questions