This documentation is archived and is not being maintained.

ContextNode.SubNodes Property

Gets the direct children of the ContextNode object.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

public ContextNodeCollection SubNodes { get; }

Property Value

Type: Microsoft.Ink.ContextNodeCollection
The direct children of the ContextNode object.

This returns only the direct children, not all of the descendants.

This example is a method that recursively traverses a tree of ContextNode objects. It uses the SubNodes property and populates a System.Windows.Forms.TreeView by adding TreeNode objects. It then sets their Text properties to GetRecognizedString.

		private void WalkTree(ContextNode parentContextNode, TreeNode parentTreeNode)
			foreach (ContextNode cNode in parentContextNode.SubNodes)
				TreeNode newTNode = new TreeNode(cNode.ToString());
				if (cNode is Microsoft.Ink.InkWordNode)
					newTNode.Text +=
						": " + ((InkWordNode)cNode).GetRecognizedString();
				else if (cNode is Microsoft.Ink.InkDrawingNode)
                    String shapeName = ((InkDrawingNode)cNode).GetShapeName();
                    if (shapeName != "")
					    newTNode.Text += ": " + shapeName;
				WalkTree(cNode, newTNode);

				// Add the context node as a tag of the tree node
				newTNode.Tag = cNode;

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.0