InkAnalyzer.GetTextRangeFromNodes - метод
Обновлен: Ноябрь 2007
Finds the text range in the recognized string that corresponds to a collection of ContextNode objects.
Пространство имен: System.Windows.Ink
Сборка: IAWinFX (в IAWinFX.dll)
Синтаксис
'Декларация
Public Sub GetTextRangeFromNodes ( _
nodesToSearch As ContextNodeCollection, _
<OutAttribute> ByRef start As Integer, _
<OutAttribute> ByRef length As Integer _
)
'Применение
Dim instance As InkAnalyzer
Dim nodesToSearch As ContextNodeCollection
Dim start As Integer
Dim length As Integer
instance.GetTextRangeFromNodes(nodesToSearch, _
start, length)
public void GetTextRangeFromNodes(
ContextNodeCollection nodesToSearch,
out int start,
out int length
)
public:
void GetTextRangeFromNodes(
ContextNodeCollection^ nodesToSearch,
[OutAttribute] int% start,
[OutAttribute] int% length
)
public void GetTextRangeFromNodes(
ContextNodeCollection nodesToSearch,
/** @attribute OutAttribute */ /** @ref */int start,
/** @attribute OutAttribute */ /** @ref */int length
)
public function GetTextRangeFromNodes(
nodesToSearch : ContextNodeCollection,
start : int,
length : int
)
Параметры
- nodesToSearch
Тип: System.Windows.Ink.ContextNodeCollection
The collection of ContextNode objects that comprise the text range.
- start
Тип: System.Int32%
When this method returns, the start parameter contains a 32-bit signed integer that indicates the start of the text range. This parameter is uninitialized when it is passed in.
- length
Тип: System.Int32%
When this method returns, the length parameter contains a 32-bit signed integer that indicates the length of the text range. This parameter is uninitialized when it is passed in.
Заметки
If nodesToSearch contains ContextNode objects that are not adjacent to each other, this method returns the smallest text range that covers all of the ContextNode objects.
This method throws a ArgumentException when nodesToSearch contains a ContextNode that is not associated with the InkAnalyzer.
Примеры
This example defines a method named SelectTextRangeFromNodes that sets the text of the TextBox (named theResultsTextBox) to the recognition string of the InkAnalyzer (named theInkAnalyzer). It then sets the text box selection to span the recognized text for the parameter, theContextNodes.
Private Sub SelectTextRangeFromNodes(ByVal theContextNodes As ContextNodeCollection)
' Set the text of theResultsTextBox.
Me.theResultsTextBox.Text = Me.theInkAnalyzer.GetRecognizedString()
' Get the text range for theContextNodes.
Dim theStart As Integer
Dim theLength As Integer
Me.theInkAnalyzer.GetTextRangeFromNodes(theContextNodes, theStart, theLength)
' Select the text range in the TextBox.
Me.theResultsTextBox.Select(theStart, theLength)
End Sub 'SelectTextRangeFromNodes
private void SelectTextRangeFromNodes(ContextNodeCollection theContextNodes)
{
// Set the text of theResultsTextBox.
this.theResultsTextBox.Text = this.theInkAnalyzer.GetRecognizedString();
// Get the text range for theContextNodes.
int theStart;
int theLength;
this.theInkAnalyzer.GetTextRangeFromNodes(
theContextNodes, out theStart, out theLength);
// Select the text range in the TextBox.
this.theResultsTextBox.Select(theStart, theLength);
}
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0