Export (0) Print
Expand All

TextWordNode Class

Represents a ContextNode for a two-dimensional region where non-ink text words may exist in the application.

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

public sealed class TextWordNode : ContextNode

The InkAnalyzer does not produce TextWordNode objects. The application uses the CreateSubNode(ContextNodeType) method to add TextWordNode objects to the context node tree. If the state of the analyzer is persisted, these nodes can be persisted as well.

Future recognizers may use the regions defined by the TextWordNode objects to determine whether any ink annotates the non-ink word.

A TextWordNode cannot have any child nodes.

The following example adds a TextWordNode object to an InkAnalyzer named theInkAnalyzer for a TextBox control named theTextBox. It sets the Data property of the TextWordNode object to the Text property of the TextBox.

// Add nodes to hold the TextWordNode
WritingRegionNode writingRegion = (WritingRegionNode)
    theInkAnalyzer.RootNode.CreateSubNode(ContextNodeType.WritingRegion);
ParagraphNode paragraph = (ParagraphNode)
    writingRegion.CreateSubNode(ContextNodeType.Paragraph);
LineNode line = (LineNode)
    paragraph.CreateSubNode(ContextNodeType.Line);

// Create node for the word
TextWordNode textWord = (TextWordNode)
    line.CreateSubNode(ContextNodeType.TextWord);


// Set location 
double textTop = InkCanvas.GetTop(theTextBox);
double textLeft = InkCanvas.GetLeft(theTextBox);

Rect rectLocation = new Rect(textLeft, textTop, theTextBox.Width, theTextBox.Height);
textWord.SetLocation(new AnalysisRegion(rectLocation));

// Set the data property to be the text in the textbox.
textWord.Data = theTextBox.Text;

System.Object
  System.Windows.Ink.ContextNode
    System.Windows.Ink.TextWordNode

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