C# Class RevitLookup.Xml.Forms.Dom

UI Test for navigating the XML Dom
Inheritance: System.Windows.Forms.Form
Datei anzeigen Open project: jeremytammik/RevitLookup

Public Methods

Method Description
Dom ( System xmlDoc ) : System

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Private Methods

Method Description
ClearSelectedNodes ( TreeNodeCollection treeNodes ) : void

When nodes are selected by XPath expressions, we highlighted them by changing the background color. Go through and reset them to normal. This function handles one level of the tree at a time and then goes recursive.

DataItemSelected ( object sender, System e ) : void
Display ( XmlNode node ) : void

Display the data values associated with a selected node in the tree.

FindTreeNodeFromXmlNodeTag ( TreeNodeCollection treeNodes, XmlNode xmlNode ) : TreeNode

Sometimes we have the Xml DOM node and we need to find where that is in our UI tree. This function will brute-force search the UI tree looking for a TreeNode.Tag that matches the XmlNode we are searching for. Note: this function is recursive.

FormatLabel ( XmlNode node ) : string

Allow the user prefernces to affect how we format the label for the tree node.

GetImageIndex ( System.Xml.XmlNodeType nType ) : int

Match a particular Image with the XML Node type. A different Icon will be used in the UI tree for each type of node.

GetTextLabelValue ( XmlNode node ) : string

Retrieve the text value for a given node

InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

LoadTree ( ) : void

This will populate the UI TreeView with all the nodes from the DOM tree

MakeTree ( System xmlNode, TreeNode parentNode ) : void

Recursive function to walk the tree and populate all the nodes

MoveToNewNodeInTree ( XmlNode newXmlNode ) : void

One of the navigation buttons ("Parent", "First Child", etc) was picked. Based on the XmlNode that those functions returned, find the corresponding UI TreeNode and make it the currently selected one.

NodeListContains ( XmlNodeList nodeSet, XmlNode findNode ) : bool

Is a given node part of the nodeSet?

OnBnClear ( object sender, System e ) : void
OnBnDocElement ( object sender, System e ) : void
OnBnFirstChild ( object sender, System e ) : void
OnBnLastChild ( object sender, System e ) : void
OnBnNextSibling ( object sender, System e ) : void
OnBnOwnerDoc ( object sender, System e ) : void
OnBnParent ( object sender, System e ) : void
OnBnPrevSibling ( object sender, System e ) : void
OnBnSelectNodes ( object sender, System e ) : void

Based on a user-specified XPath expression, try to find any matching nodes. If found, change the background of the labels to a different color and make the first item the current selection in the UI Tree.

OnBnSelectSingleNode ( object sender, System e ) : void

Based on a user-specified XPath expression, try to find a matching node. If found, change the background of the label to a different color and make that item the current selection in the UI Tree.

OnCbChanged_NodeDisplay ( object sender, System e ) : void
OnRbChanged_LabelDisplay ( object sender, System e ) : void
SetButtonModes ( XmlNode node ) : void

Do a preview check to see which navigation buttons are going to work. Disable the ones that will not.

SetSelectedNode ( TreeNodeCollection treeNodes, XmlNode selNode ) : void

Change the background color of the matching node

SetSelectedNodes ( TreeNodeCollection treeNodes, XmlNodeList selNodes ) : void

Same as SetSelectedNode(), but with a set of matches. NOTE: You cannot manually add to an XmlNodeList, so I couldn't have the above function call this one.

TreeNodeSelected ( object sender, System e ) : void

The user selected a UI TreeNode. Update the Display based on the new selection

Method Details

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool
return void

Dom() public method

public Dom ( System xmlDoc ) : System
xmlDoc System
return System