Introduction
I finally found time to post the Enhanced QuickWatch add-in for VS.NET 2003. About a year ago, I developed the Add-In using the basic concept and code from a few posts and added several other useful features that are of immense help when trying to visualize XML Serializable Objects, DataSets, XML Documents and Strings, Exception Stacks, etc. Just as I was planning to upgrade to VS.NET 2005, I decided to make an effort to post the Add-In for VS.NET 2003.
Several people need to be thanked for ideas, code and implementations. I can't remember all the sources but the basic concept and code was from a couple of developers, Mohammed Barqawi and Matt Simner amongst others. I also used XmlVisualizer.UI.ScintillaControls.dll, one of the Wrapper controls for Scintilla Editor.
What It Does?
The Enhanced QuickWatch provides visualization of the following.
Usage
- Right click on the variable in debug mode and click the Enhanced QuickWatch menu item. If this fails to select the right variable , you can try selecting the whole variable and try the same. The rule is written such that if no selection, it uses the
TextSelection
classes method WordRight()
and WordLeft()
to determine the variables length. You can view the selected variable in the code as it is highlighted.
- You can continue using the QuickWatch even after the debugging session ends as the window will remain open. You can also right click and launch the add-in in the source code in Visual Studio or launch it from the tools menu when not in debug mode, which is helpful for loading XML files to visualize as datasets and/or use the XML viewer.
DataSet
s, strongly typed DataSet
s, DataTable
s and DataRow
s.
- XML representation of the
DataSet
s and its XmlSchema
are retrieved by GetXml()
and GetXmlSchema()
methods.
- The
DataSet
s tables are displayed in separate tables and two tabs are used to display the list of Tables and Relationships in the DataSet
.
- When visualizing a
DataTable
or DataRow
, the tab will be auto selected.
- Ensure that when viewing
DataTable
Or DataRow
that they are part of a DataSet
, because the QuickWatch
rebuilds the dataset
from the evaluations of GetXml()
and GetXmlSchema()
calls on the DataTable
/DataRow
's associated Dataset
.
XmlDocument
, XML strings, Objects that have ToXml()
methods.
- When viewing
XmlDocuments
or XML string, the XML will be loaded into a dataset
and displayed in the appropriate Tab to provide alternate visualization.
- Exceptions can be viewed in the exception viewer control and clicking the appropriate line in the stack trace will open the code file and highlight the line the exception occurred.
- A Row Filter can be established for active or deleted rows, using standard row filter expressions.
- There is no need to select the whole variable to view, only right clicking on the variable name and clicking the Quickwatch from the menu will do the trick.
- If any unsupported type is found, the default
ToString()
representation of the object is displayed.
- Separate Tab is used to display any errors occurring during parsing and/or display .
- Load XML Files from the file menu in order to check the dataset representation of the XML files.
Using the Code
I got a request for the source code, so I removed customizations that I was using specifically for my projects, but there might still be some unimplemented menu items that might be disabled or invisible.
I believe the source code is self documenting, but I'd mention that I have separated the major features into separate projects. The main solution DebugViewer.sln is in the DebugViewer folder. There are several test projects I created for testing individual components and zipped up the whole project folder structure so you might find unnecessary files.
I only spent limited time on this project and haven't had the time to refactor it once it got stabilized. I did encounter a couple of issues (I use it daily and have had about 2-3 issues in the past year) and didn't investigate into the root cause. Please feel free to enhance, add features or fix bugs if encountered.
History
- 7th April, 2006: Initial post