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)

Syntax

'Declaration
Public NotInheritable Class CustomRecognizerNode _
    Inherits ContextNode
'Usage
Dim instance As CustomRecognizerNode
public sealed class CustomRecognizerNode : ContextNode
public ref class CustomRecognizerNode sealed : public ContextNode
public final class CustomRecognizerNode extends ContextNode

Remarks

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.

Examples

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.

Dim customRecognizer As CustomRecognizerNode = _
    theInkAnalyzer.CreateCustomRecognizer(customRecognizerId)
theInkAnalyzer.AddStrokesToCustomRecognizer(strokesForCustomAnalysis, customRecognizer)

Dim theStatus As AnalysisStatus = theInkAnalyzer.Analyze()
theResultsTextBox.Text = customRecognizer.GetRecognizedString()
CustomRecognizerNode customRecognizer =
    theInkAnalyzer.CreateCustomRecognizer(customRecognizerId);
theInkAnalyzer.AddStrokesToCustomRecognizer(strokesForCustomAnalysis, customRecognizer);

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

Inheritance Hierarchy

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

Thread Safety

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

Platforms

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.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

CustomRecognizerNode Members

System.Windows.Ink Namespace