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:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.dll)

public class ContextNodeCollection : ICollection, 
	IEnumerable

The following example shows how to loop through a ContextNodeCollection from the InkAnalyzer. FindNodesOfType(ContextNodeType, ContextNode) method of an InkAnalyzer named theInkAnalyzer. The example loops through a collection of LineNode objects and, if two consecutive InkWordNode objects are the same word, it makes their strokes 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.
ContextNodeCollection lines =
    theInkAnalyzer.FindNodesOfType(ContextNodeType.Line);
foreach (ContextNode lineNode in lines)
{
    InkWordNode previousWord = null;
    foreach (InkWordNode inkWord in
             theInkAnalyzer.FindNodesOfType(ContextNodeType.InkWord, lineNode))
    {
        if (previousWord != null &&
            previousWord.GetRecognizedString() == inkWord.GetRecognizedString())
        {
            foreach (Stroke stroke in previousWord.Strokes)
                stroke.DrawingAttributes.Color = Colors.Red;
            foreach (Stroke stroke in inkWord.Strokes)
                stroke.DrawingAttributes.Color = Colors.Red;
        }
        previousWord = inkWord;
    }
}

System.Object
  System.Windows.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 XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

Reference

[O:System.Windows.Ink.InkAnalyzer.FindNodes]
[O:System.Windows.Ink.InkAnalyzer.FindNodesOfType]
Show: