When you have to browse the elements of a list (array) in the Visual Studio debugger, for example, in the QuickWatch window you often come across the inconvenience of viewing a complex (or long) list of data. It is difficult to see, for example, the field values of all the elements of the list.
This post shows several "built-in" solutions to this problem and the possibility of expanding
BugAid .
few letters, but enough pictures.
Consider the simplest example.
')
public class DataItem { public string Name { get; private set; } public string Description { get; private set; } public DataItem(string name, string description) { Name = name; Description = description; } } public class DataItems { public List<DataItem> Items { get; private set; } public DataItems() { Items = new List<DataItem>(); } }
Now, looking at the data in the debugger, we see something like this:

Standard QuickWatch does not allow us to see a specific field (or formatted fields)
for all list items at once .
To solve this problem, many developers know the straightforward way to implement the
ToString () method:
public class DataItem { public string Name { get; private set; } public string Description { get; private set; } public DataItem(string name, string description) { Name = name; Description = description; } public override string ToString() { return String.Format("{0}: {1}", Name, Description); } }

or more "attribute" method:
[DebuggerDisplay("Name = {Name}, Desciption = {Description}")] public class DataItem { public string Name { get; private set; } public string Description { get; private set; } public DataItem(string name, string description) { Name = name; Description = description; } }

it should be noted that for more complex tasks there is an attribute
DebuggerTypeProxy , but it is not the limit :).
These two methods are good, but they have the disadvantage that all this must be written in the program code and compiled. But often you need to consider the data list in different formats. Stopping the debugger for this, changing the code or attribute, recompiling and running again is a very laborious way.
As it turned out, there is an extension
BugAid for Visual Studio (at least c VS2010), which solves this problem, and at the same time some others.
After installing this extension, the BugAid menu appears with a couple of options and its own “BugAid - QuickWatch” window.
Now you can use the asterisk to select the fields that you want to look for all list items.

and voila

But that is not all. rather, everything is just beginning.
and after all it would be desirable to stir up any format for the data and to show something such. In this case, you can use the "
Add Custom Expression ", add an expression for the list item: something like "
[obj] .Name.Length "

and “enjoy” the custom data format without compilation and “contribution”:

and how often would Google want to look for some data in a complex list?
so here in the
Search field, what you want to find and get:



but to compare a couple of list items to each other.
you can and this: select the first item through the menu "
Select Left Side For Compare ", and then the second - "
Compare to ... " and see the difference:

well then it would be good to filter the data:


In addition, you can save items and compare items in time.
The BugAid extension has several interesting features (for example,
to render complex expressions in an if statement ).
so I think this extension deserves the attention of the developers.
A few words about the shortcomings that I discovered.
- This is not a release, but a beta, so it does not always work stably. The more complex the data structure, the probability of any problems increases.
- Some standard functionality (for example, the DebuggerTypeProxy attribute) is not supported by the extension.
- The extension is not free, but there is a two-month free period of use.
By the way, the support site
http://bugaidsoftware.userecho.com/ is quite convenient and respects gamification, which in this case is more good than not.
thank,
Igor