Debugging the DOM with Visual Studio - kaisu1986/ATF GitHub Wiki
The DomNode class has the _DebugInfo property that gathers information about the node's contents and formats it so the information is easier to access. The illustration shows this property for a DomNode:
Note that the value of the DomNode itself (this) shows a hash code along with the node's DomNodeType. Hash codes are the equivalent of unique IDs for the current debugging session; they are unique to the AppDomain, the application domain that is an isolated environment where applications execute.
The _DebugInfo property contains several categories of information, shown in the figure. You can also open nodes under _DebugInfo in the debugger to get more information on the displayed data.
You can find out what objects subscribe to any of the six DomNode events listed under _DebugInfo:
-
AttributeChangedunderAttributeChangedListeners. -
AttributeChangingunderAttributeChangingListeners -
ChildInsertedunderChildInsertedListeners -
ChildInsertingunderChildInsertingListeners -
ChildRemovedunderChildRemovedListeners -
ChildRemovingunderChildRemovingListeners
ChildInsertingListeners node shows one listener, which is the DOM adapter MasteringValidator. Opening the listener node reveals the method called when the event occurs and the Target, which is the listener itself.
The Attributes node lists all the attributes' names and values:
-
AttributeInfo's string value for the name. -
GetAttribute()'s string value for the value.
The Children node displays the DomNode children's names and values, if any:
-
ChildInfo's string value for the name. - Child
DomNode's string value for the value.
All extensions defined for the DomNode's type are also listed, including their count, as shown in this figure:
The value has three parts:
- The extension name, which is nearly always a DOM adapter.
- The HashCode of the
DomNode. - The
DomNodeTypeof theDomNode.
The information under _DebugInfo is provided by creating new classes in DomNode and marking these classes with special attributes. You can use these techniques to enhance the display of your own classes and data. For details, see Visual Studio Debugger Display Attributes and Other Features.