Enhanced QuickWatch





3.00/5 (4 votes)
A Visual Studio .NET 2003 add-in to view XML, Datasets and Exceptions

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 methodWordRight()
andWordLeft()
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 typedDataSet
s,DataTable
s andDataRow
s.- XML representation of the
DataSet
s and itsXmlSchema
are retrieved byGetXml()
andGetXmlSchema()
methods. - The
DataSet
s tables are displayed in separate tables and two tabs are used to display the list of Tables and Relationships in theDataSet
. - When visualizing a
DataTable
orDataRow
, the tab will be auto selected. - Ensure that when viewing
DataTable
OrDataRow
that they are part of aDataSet
, because theQuickWatch
rebuilds thedataset
from the evaluations ofGetXml()
andGetXmlSchema()
calls on theDataTable
/DataRow
's associatedDataset
. XmlDocument
, XML strings, Objects that haveToXml()
methods.- When viewing
XmlDocuments
or XML string, the XML will be loaded into adataset
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