Using OzCode to flatten class hierarchies while debugging

While debugging deep class hierarchies in Visual Studio, I was often annoyed by having to constantly expand the “base” nodes to get to see the members I wanted to see. This happens because Visual Studio  only shows fields and properties declared on the given type, and tucks all the members of the base classes under the “base” node. This is helpful in some cases, but more often than not, I found that it gets in my way.

And so, after trying Jared’s solution, I decided to have a go at it and try to fix this problem in OzCode.

The idea is that if you’re interested in a property of the base class, you can star that property, which causes the property to appear at the top of members list, and also in the text of its parent.

So for example, in the following scenario, I had to expand two base nodes to get to see the properties I wanted, “Important” and “Interesting”:

But once I star these properties, they will always appear at the top, even when viewing variables of the Derived type, so I’ll see:

These stars are persisted and will be shown whenever you view an object of that type in the DataTip or QuickWatch window from that moment on, so the next time you view a variable of that type, you won’t need to expand those “base” nodes.

Also, because starred values appear as the parent node’s text, if you’re looking at, say, a list of these deeply nested objects, you will be able to see the starred properties and fields without even expanding the nodes at all.



Keep your code in good shape!

Subscribe to our blog and follow the latest news in the .NET debugging industry

Ready to Dive into Your Prod Code?

Easy debugging with full time-travel data

The Exception

A Quarterly Roundup

Subscribe to our quarterly newsletter and hear all about what’s happening around debugging with Ozcode

Share on facebook
Share on twitter
Share on linkedin
Share on email

Recent Posts

Follow Us

Join Ozcode YouTube Channel

Let’s start debugging, it’s free!

Thanks for downloading the OzCode trial!

You’re well on your way to making C# even sharper.

If your download doesn’t start automatically , please use this direct link.

If you’d like to install OzCode but don’t have
administrative privileges on your machine, please contact us.

Get Started for FREE!

Ozcode Logo

This website uses cookies to ensure you get the best experience on our website.