How to create a DebuggerVisualizer for build in generic classes or arrays

35 views Asked by At

I am using VisualStudio DebuggerVisualizer for many of my own classes by applying the DebuggerVisualizer attribute to those classes. Now I would also like to show something like List<MyClass> with a single DialogDebuggerVisualizer. Of course I can open such a list in QuickWatch and view each item, but the whole list doesn't show the "magnifying glass", with which in turn I could show my DialogDebuggerVisualizer. I cannot add the DebuggerVisualizer attribute to List<MyClass>, nor can I add an extension property to List<MyClass> (which would return a DebuggerVisualizer attributed object). The only way I found so long is having some static method which takes List<MyClass> as a parameter and returns an object with the DebuggerVisualizer attribute set. This is sometimes cumbersome when you are deep down in a hierarchy of objects. Is there a better solution?

0

There are 0 answers