view data in a collection while debugging?  
Author Message
Darin V





PostPosted: Visual C# IDE, view data in a collection while debugging? Top

I can see the data in datasets with the visualizer. With collections I get a datatip that allows me to expand and expand and expand but I can never find the data. Is there an easy way to view data in a collection object while debugging


Visual C#20  
 
 
TaylorMichaelL





PostPosted: Visual C# IDE, view data in a collection while debugging? Top

The current approach is about as optimal as you can get but if you are looking for something better then you can write your own visualizer. A visualizer is one of the easiest components to write for VS. You can then do anything you like with it. For a collection you might look at the article from http://blogs.msdn.com/scottno/archive/2005/04/14/408257.aspx where someone wrote a visualizer for a hashtable.

In your case you could create a visualizer that displays a modal window with each element of the collection as an element in the list. Attaching a property grid will allow you to edit the properties of the collection element. You should target the ICollection interface in order to support all the possible collections available.

Michael Taylor - 12/20/06


 
 
Anson Horton MSFT





PostPosted: Visual C# IDE, view data in a collection while debugging? Top

Daren,

Michael's suggestion is good. The other option is to write a de**** type proxy. It serves a similar purpose to a visualizer except it isn't modal, so you can use it with the de**** data tips. http://www.hide-link.com/ (VS.80).aspx

Anson



 
 
anothersam





PostPosted: Visual C# IDE, view data in a collection while debugging? Top

Surely Microsoft should have written de**** components for their own types They did it for System.Array, so why didn't they for System.Collections ! The crazy thing is (with De****TypeProxy etc) that the user could do this - so they surely should have.

It is not practical for users to create wrapper classes DebuggableCollection, DebuggableStack, because they will already be debugging code written against these 'built-in' types. Microsoft should modify all their implementations of IEnumerable to show an extra item when expanded in the de**** which contains the array of objects in the collection.

I want to post this feedback through 'Connect' but cannot work out how. Does anyone know how to use Connect