Share via


InkAnalyzerBase.GetTextRangeFromNodes Method

Finds the text range in the recognized string that corresponds to a collection of context nodes.

Namespace: System.Windows.Ink.AnalysisCore
Assembly: IACore (in iacore.dll)

Syntax

'Declaration
Public Sub GetTextRangeFromNodes ( _
    nodesToSearch As ContextNodeBaseCollection, _
    <OutAttribute> ByRef start As Integer, _
    <OutAttribute> ByRef length As Integer _
)
'Usage
Dim instance As InkAnalyzerBase
Dim nodesToSearch As ContextNodeBaseCollection
Dim start As Integer
Dim length As Integer

instance.GetTextRangeFromNodes(nodesToSearch, start, length)
public void GetTextRangeFromNodes (
    ContextNodeBaseCollection nodesToSearch,
    out int start,
    out int length
)
public:
void GetTextRangeFromNodes (
    ContextNodeBaseCollection^ nodesToSearch, 
    [OutAttribute] int% start, 
    [OutAttribute] int% length
)
public void GetTextRangeFromNodes (
    ContextNodeBaseCollection nodesToSearch, 
    /** @attribute OutAttribute() */ /** @ref */ int start, 
    /** @attribute OutAttribute() */ /** @ref */ int length
)
Not applicable.

Parameters

  • nodesToSearch
    The collection of context nodes for which to find the text range.
  • start
    When this method returns, the start parameter contains a 32-bit signed integer that indicates the start of the text range. This parameter is passed uninitialized.
  • length
    When this method returns, the length parameter contains a 32-bit signed integer that indicates the length of the text range. This parameter is passed uninitialized.

Remarks

If nodesToSearch contains ContextNodeBase objects that are not consecutive, then this method returns the smallest text range that covers all of the context nodes.

This method throws a System.ArgumentException when nodesToSearch contains a context node that is not associated with the InkAnalyzerBase.

Example

The following example retrieves the text range for the first line node of the InkAnalyzerBase, theInkAnalyzerBase.

' Get all line nodes.
Dim theLineNodes As System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection = _
    theInkAnalyzerBase.FindNodesOfType( _
        System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line)

' Remove all but the first line node.
If 0 < theLineNodes.Count Then
    Dim firstLineNode As System.Windows.Ink.AnalysisCore.ContextNodeBase = theLineNodes(0)
    theLineNodes.Clear()
    theLineNodes.Add(firstLineNode)
End If

' Get the text range for the first line node.
Dim selectionStart As Integer = 0
Dim selectionLength As Integer = 0
If 0 < theLineNodes.Count Then
    theInkAnalyzerBase.GetTextRangeFromNodes( _
        theLineNodes, selectionStart, selectionLength)
End If
// Get all line nodes.
System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection theLineNodes =
    theInkAnalyzerBase.FindNodesOfType(
        System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line);

// Remove all but the first line node.
if (0 < theLineNodes.Count)
{
    System.Windows.Ink.AnalysisCore.ContextNodeBase firstLineNode = theLineNodes[0];
    theLineNodes.Clear();
    theLineNodes.Add(firstLineNode);
}

// Get the text range for the first line node.
int selectionStart = 0;
int selectionLength = 0;
if (0 < theLineNodes.Count)
{
    theInkAnalyzerBase.GetTextRangeFromNodes(
        theLineNodes, out selectionStart, out selectionLength);
}

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkAnalyzerBase Class
InkAnalyzerBase Members
System.Windows.Ink.AnalysisCore Namespace
System.Windows.Ink.AnalysisCore.InkAnalyzerBase.GetNodesFromTextRange