Поделиться через


CustomRecognizerNode - класс

Обновлен: Ноябрь 2007

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.

Пространство имен:  System.Windows.Ink
Сборка:  IAWinFX (в IAWinFX.dll)

Синтаксис

'Декларация
Public NotInheritable Class CustomRecognizerNode _
    Inherits ContextNode
'Применение
Dim instance As CustomRecognizerNode
public sealed class CustomRecognizerNode : ContextNode
public ref class CustomRecognizerNode sealed : public ContextNode
public final class CustomRecognizerNode extends ContextNode
public final class CustomRecognizerNode extends 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.

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();

Иерархия наследования

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

Потокобезопасность

Любые открытые члены этого типа, объявленные как static (Shared в Visual Basic), являются потокобезопасными. Потокобезопасность членов экземпляров не гарантируется.

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

CustomRecognizerNode - члены

System.Windows.Ink - пространство имен