Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Is there a way to quickly find all classes that override a given method? Maybe it would work like the "Find all References" item on the code context menu so you'd get a list of them in the Find Symbol Results window. This would be so useful because, without it, I'm having to look at all classes that inherit a class and might override a method in order to fully understand that method, and that's cumbersome. Any thoughts?
  • Leaders
Posted

It's an interesting question. The thing is, there is no reason that the runtime would ever need this and it isn't a very common need, even when dealing with reflection.

 

As far as I know reflection doesn't directly support that kind of analysis. I'm guessing that what you have is the best you can do: enumerate the types and examine those that derive from the class in question. Is this causing a performance issue? Or were you just looking for a better way?

[sIGPIC]e[/sIGPIC]
Posted
There's no performance issue, other than my own personal performance (!). It would be helpful to quickly be able to see how I was dealing with a method across the classes, rather than having to think about what classes I have that might override a method, and then check them all, opening extra windows in the process. There's so much that the Visual Studio does that I'm surprised this doesn't seem to have been dealt with, but perhaps I'm unusual in wishing for it.
Posted (edited)

Or maybe it wouldn't be that hard to write an add-in myself. I remember doing this in the old Visual Basic. That way I can get it to do just what I want, and there's no time involved in figuring out what someone else's solution does.

 

Or actually the Find Symbol Command does pretty much what I want. Anyone know how to add this to the code context menu? I've tried through Tools/Customize/Rearrange Commands but can't see how to add buttons to this menu.

Edited by rbulph

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...