“Have you ever been stepping through a program and tried to inspect an object only to find it has an internal structure that make it very difficult to really see what is going on in there? I recently ran into a third party object that was causing me that problem over and over so I decided to do something about it. I wrote my own debugging visualizer to take the object and put it into a format that is easy to read. I was surprised how easy it is to do, so lets create one.
The object I was struggling with was storing collections of name/value pairs internally in 2 different collections. So I’d have to find the key I’m interested in, note the index and find the corresponding index in the values collection. It was actually worse than this since the collections were also hierarchical. Ouch. So I put together a simple class that demonstrates this called WeirdCollection. It looks like this:
Been a while since I’ve seen a good article on writing your own Debugging Visualizer…
Related Past Post XRef:
One gets you Ten. One DLL, Ten free WCF Debugger Visualizers
A Couple Custom Debugger Visualizers (For VS2005, but with source...)