InkAnalyzerBase.GetNodesFromTextRange Method (Int32%, Int32%)
Returns a collection of context nodes that are relevant to the specified text range.
Namespace: System.Windows.Ink.AnalysisCore
Assembly: IACore (in IACore.dll)
Syntax
'Declaration
Public Function GetNodesFromTextRange ( _
ByRef start As Integer, _
ByRef length As Integer _
) As ContextNodeBaseCollection
'Usage
Dim instance As InkAnalyzerBase
Dim start As Integer
Dim length As Integer
Dim returnValue As ContextNodeBaseCollection
returnValue = instance.GetNodesFromTextRange(start, _
length)
public ContextNodeBaseCollection GetNodesFromTextRange(
ref int start,
ref int length
)
public:
ContextNodeBaseCollection^ GetNodesFromTextRange(
int% start,
int% length
)
public function GetNodesFromTextRange(
start : int,
length : int
) : ContextNodeBaseCollection
Parameters
start
Type: System.Int32%A reference to the start of the text range in the recognized string.
length
Type: System.Int32%A reference to the length of the text range in the recognized string.
Return Value
Type: System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection
The collection of context nodes that are relevant to the specified text range.
Remarks
This method modifies the values of the start and length parameters by expanding the text range to the nearest word boundaries.
For example, if the recognized string is "I am late" and you call this method using the parameter values of 6 for start and 1 for length, which corresponds to the letter "a" in "late", this method returns a collection containing a single ContextNodeBase. The collection contains the ink word or text word node that corresponds to the word "late." For this example, this method also modifies the value of start to 5 and the value of length to 4, which corresponds to the word "late".
Examples
The following example gets the context nodes that contain the first five characters of the top recognized string of the InkAnalyzerBase, theInkAnalyzerBase. It retrieves analysis alternates for these nodes and then displays the alternates using a helper method, ShowAlternates.
If 5 < theInkAnalyzerBase.GetRecognizedString().Length Then
' Get the nodes that correspond to the first five
' characters of the results for the ink analyzer.
Dim selectionStart As Integer = 0
Dim selectionLength As Integer = 5
Dim selectedSubNodes As System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection = _
theInkAnalyzerBase.GetNodesFromTextRange( _
selectionStart, selectionLength)
' Get analysis alternates for corresponding nodes.
Dim theAlternates As System.Windows.Ink.AnalysisCore.AnalysisAlternateBaseCollection = theInkAnalyzerBase.GetAlternates(selectedSubNodes)
' Display the alternates using a helper method.
Me.ShowAlternates("Alternates for the selection:", theAlternates)
End If
if (5 < theInkAnalyzerBase.GetRecognizedString().Length)
{
// Get the nodes that correspond to the first five
// characters of the results for the ink analyzer.
int selectionStart = 0;
int selectionLength = 5;
System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection selectedSubNodes =
theInkAnalyzerBase.GetNodesFromTextRange(
ref selectionStart, ref selectionLength);
// Get analysis alternates for corresponding nodes.
System.Windows.Ink.AnalysisCore.AnalysisAlternateBaseCollection theAlternates =
theInkAnalyzerBase.GetAlternates(selectedSubNodes);
// Display the alternates using a helper method.
this.ShowAlternates(
"Alternates for the selection:", theAlternates);
}
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
GetNodesFromTextRange Overload