Export (0) Print
Expand All

CustomRecognizerNode Class

Represents a ContextNode for a single recognition operation. All strokes and nodes stored under a CustomRecognizerNode object are recognized in an independent recognition operation and are not analyzed by the InkAnalyzer.

Namespace:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.dll)

public sealed class CustomRecognizerNode : ContextNode

A CustomRecognizerNode object may contain any type of ContextNode except RootNode. A CustomRecognizerNode object must be the direct child of the RootNode.

The simplest way to create a custom recognizer is to use InkAnalyzer.CreateCustomRecognizer to create the recognizer and to use InkAnalyzerAddStrokesToCustomRecognizer(StrokeCollection, ContextNode) to assign strokes to it. If any stroke that you add is already assigned to any node in the InkAnalyzer context tree, including an UnclassifiedInkNode, an ArgumentException is thrown. To avoid this, use InkAnalyzer.RemoveStroke or InkAnalyzer.RemoveStrokes to remove those strokes from the InkAnalyzer context tree before adding them to the custom recognizer.

The following example takes a Guid for a custom recognizer named customRecognizerId, and creates a CustomRecognizerNode with it for an InkAnalyzer named theInkAnalyzer. Strokes are then added from a StrokeCollection, strokesForCustomAnalysis. Then Analyze is called and the recognized string is put into a TextBox, theResultsTextBox.

CustomRecognizerNode customRecognizer =
    theInkAnalyzer.CreateCustomRecognizer(customRecognizerId);
theInkAnalyzer.AddStrokesToCustomRecognizer(strokesForCustomAnalysis, customRecognizer);

AnalysisStatus theStatus = theInkAnalyzer.Analyze();
theResultsTextBox.Text = customRecognizer.GetRecognizedString();

System.Object
  System.Windows.Ink.ContextNode
    System.Windows.Ink.CustomRecognizerNode

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

Community Additions

ADD
Show:
© 2014 Microsoft