Sign in to follow this  
braincell

[.net] How to list all methods that reference member of a class?

Recommended Posts

braincell    115
Many times while coding, I need to create a list of all methods within the solution that use a certain member of a class.

Right now the way I make this list is going to [i]Find All References [/i]and clicking through all of the results and writing down the methods where they appear by hand.
I'm thinking, there must be a better way, right?

I need this during debugging quite often, for example finding out if a member is accessed within a threaded method and when locking needs to be done, etc. Also for documentation purposes, and especially when dealing with somebody elses undocumented code.
I'm using VS2008 with VB.Net.

I see that Visual Assist find references does a better job by listing them in alphabetical order, but it seems to be missing a few methods (crucially), and i still cannot copy/paste, so I need to type it all out by hand.

It would be very helpful if someone with experience could point me in the right direction, or show me a plugin that does this. Thanks!

Share this post


Link to post
Share on other sites
a_loho    106
In VS2010 there is the Call Hierarchy Window (Ctrl + K, Ctrl + T) that lists methods that call the method accross the whole solution, it also list methods called from this one, as well as methods that overrides it. I couldn't find it on my VS2008 install though, it may be a new feature. Works only if you can upgrade to VS2010 of course.

Share this post


Link to post
Share on other sites
braincell    115
Hmm yes, I just googled it and it seems to be a new feature of VS2010. Very useful!

OK so now it's definitely time to upgrade, but until then any other recommendations are welcome.
It would still be kind of nice if I could copy/paste the results in plain text, but maybe that's asking too much.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this