views:

118

answers:

2

When I try to see the internal list of Dictionary item I hate to expand every single node one by one. I'm looking for an easier way to do this.

For example:

I've got a Dictionary object Dictionary(Of AnotherObject, Integer) and I want see a property of AnotherObject as a list during the debug.

Normally I'd use this:

For Each item As DictionaryEntry(Of AnotherObject, Integer) in myDict
          Debug.Writeline(item.Name)
Next

But immediate window doesn't support loops.

Is there any practical way to do this in immediate window or debug visualizers?

+2  A: 

Have you had a look at VS Visualizers?

A Generic List and Dictionary Debugger Visualizer for VS.NET

and

Write Your Own Visualizer for VS Debugging

astander
You might want to write a visualizer that first transforms your List<T> or Dictionary<K,T> to a DataTable, and then uses the build in visualizer for that. The conversion to DataTable will use a schema that is specific to the type T.
Aviad P.
Awesome thanks, Visualise window is not resizable but hey :) Maybe I'll fix it later on.
dr. evil
A: 

While you can't use loops in the immediate window, it does allow you to declare new variables, so you can create new lists etc. which can then be displayed in the watch window.

Brian Rasmussen