I'm trying to find all member fields (but not local variables) of a particular type (e.g. Widget) across a large codebase.
I'm using VS2005 but don't mind non-vs solutions.
If I were using C++ I could limit my search to header files, but that doesn't work in c#
I could search for "Widget m_" but that risks missing fields that haven't been named correctly.
Any other ideas?
Further info:
I have a definitive list of Widgets in my WidgetManager. Any other class can have a pointer to a Widget. If I delete a Widget from my WidgetManager, I want all the other pointers to that widget (wherever they might be in the solution) to be set to null.
A "destroyed" event is raised when a Widget is removed from my WidgetManager. I was thinking of catching that event in all the classes that store references to Widgets, and setting their references to null when Widgets were deleted. The point of my original question is to verify that I've found all the references.
If anyone can think of a Better Way then let me know.