This documentation is archived and is not being maintained.

ContextNodeCollection Class

Contains a collection of ContextNode objects that are the result of an ink analysis.

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

'Declaration
Public Class ContextNodeCollection _
	Implements ICollection, IEnumerable
'Usage
Dim instance As ContextNodeCollection

The following example shows how to loop through a ContextNodeCollection from the InkAnalyzer. FindNodesOfType(ContextNodeType, ContextNode) method of an InkAnalyzer, theInkAnalyzer. The example loops through all of the line nodes and, if two ink word nodes are present with the same word, then it marks them as red.

' If two identical ink words occur next to each other, mark them as red. 
' Note: This doesn't actually look for pairs that go across two lines. 
Dim lines As ContextNodeCollection = _
    theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.Line)
Dim lineNode As ContextNode
Dim stroke As Stroke

For Each lineNode In lines

    Dim previousWord As InkWordNode = Nothing 
    Dim inkWord As InkWordNode
    For Each inkWord In _
        theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkWord, lineNode)

        If Not (previousWord Is Nothing) AndAlso _
                previousWord.GetRecognizedString() = inkWord.GetRecognizedString() Then 

            For Each stroke In previousWord.Strokes
                stroke.DrawingAttributes = New DrawingAttributes(Color.Red)
            Next stroke
            For Each stroke In inkWord.Strokes
                stroke.DrawingAttributes = New DrawingAttributes(Color.Red)
            Next stroke
        End If
        previousWord = inkWord
    Next inkWord
Next lineNode

System.Object
  Microsoft.Ink.ContextNodeCollection

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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
Show: