views:

40

answers:

1

Is there some way to make the Watch window display all inherited properties and fields in one long flat list, rather than hidden behind a nested "base" node?

I'm debugging some C# code that makes massive use of inheritance - some of the properties I want to watch are behind three levels of "base" in the Watch window. This would be more or less bearable if I just wanted to examine a single such object, but I'm actually looking at a tree of them...

+1  A: 

Not as such. You see, it is a feature! The ability to see where a property comes from is important most of the time.

I understand your pain though. There are some work arounds. First, you can just put the object.property in the watch window. This will just display the property you are looking for. It is great for digging into a specific property but not so much for getting all the others.

You can also try (BaseClass)object. This will cast it to the base object that contains the property (properties?) you are looking for. Again it is great for looking a a specific subset of properties but completly hides all the others.

Good luck and good hunting.

Craig
Thanks, unfortunately neither of those ideas can help me view objects deep inside the tree :(
romkyns
If you are talking about a private member of a DEEP class, you *should* be able to use the cast. As I do not know your code, you might be correct in that you have to drill. If that is the case, you just might be up the creek as they say.
Craig