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


CustomRecognizerNode - класс

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

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

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink.Analysis (в Microsoft.Ink.Analysis.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 node can contain he following types of child elements:

  • Any number of Unclassified Ink nodes.

  • Any number of Object nodes.

  • Any number of Line nodes.

  • Any number of InkWord nodes.

  • Any number of nodes with an unknown Guid value.

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 InkAnalyzer.AddStrokesToCustomRecognizer 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, customRecognizerId, and creates a CustomRecognizerNode with it for an InkAnalyzer, theInkAnalyzer. Strokes are then added from a Strokes collection, 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 Microsoft.Ink.AnalysisStatus = theInkAnalyzer.Analyze()
theResultsTextBox.Text = customRecognizer.GetRecognizedString()
CustomRecognizerNode customRecognizer = 
    theInkAnalyzer.CreateCustomRecognizer(customRecognizerId);
theInkAnalyzer.AddStrokesToCustomRecognizer(strokesForCustomAnalysis, customRecognizer);

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

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

System.Object
  Microsoft.Ink.ContextNode
    Microsoft.Ink.CustomRecognizerNode

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

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

Платформы

Windows Vista

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

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

.NET Framework

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

См. также

Ссылки

CustomRecognizerNode - члены

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