업데이트: 2007년 11월
인식된 문자열에서 ContextNode 개체의 컬렉션에 해당하는 텍스트 범위를 찾습니다.
네임스페이스: 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
텍스트 범위를 구성하는 ContextNode 개체의 컬렉션입니다.
- start
형식: System.Int32%
이 메서드가 반환될 때 start 매개 변수에는 텍스트 범위의 시작 부분을 나타내는 부호 있는 32비트 정수가 포함됩니다. 이 매개 변수는 초기화되지 않은 상태로 전달됩니다.
- length
형식: System.Int32%
이 메서드가 반환될 때 length 매개 변수에는 텍스트 범위의 길이를 나타내는 부호 있는 32비트 정수가 포함됩니다. 이 매개 변수는 초기화되지 않은 상태로 전달됩니다.
설명
nodesToSearch에 서로 인접하지 않은 ContextNode 개체가 들어 있으면 이 메서드는 모든 ContextNode 개체를 포함하는 가장 작은 텍스트 범위를 반환합니다.
nodesToSearch에 InkAnalyzer와 연결되지 않은 ContextNode가 포함된 경우 이 메서드는 ArgumentException을 throw합니다.
예제
이 예제에서는 TextBox(theResultsTextBox)의 텍스트를 InkAnalyzer(theInkAnalyzer)의 인식 문자열로 설정하는 SelectTextRangeFromNodes라는 메서드를 정의합니다. 그런 다음 매개 변수 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에서 지원