다음을 통해 공유


LineNode.GetTextRangeFromNodes 메서드

업데이트: 2007년 11월

LineNode의 하위 항목인 ContextNode 개체 컬렉션에 해당하는 인식된 문자열에서 텍스트 범위를 찾습니다.

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink.Analysis(Microsoft.Ink.Analysis.dll)

구문

‘선언
Public Sub GetTextRangeFromNodes ( _
    subTree As ContextNodeCollection, _
    <OutAttribute> ByRef start As Integer, _
    <OutAttribute> ByRef length As Integer _
)
‘사용 방법
Dim instance As LineNode
Dim subTree As ContextNodeCollection
Dim start As Integer
Dim length As Integer

instance.GetTextRangeFromNodes(subTree, _
    start, length)
public void GetTextRangeFromNodes(
    ContextNodeCollection subTree,
    out int start,
    out int length
)
public:
void GetTextRangeFromNodes(
    ContextNodeCollection^ subTree, 
    [OutAttribute] int% start, 
    [OutAttribute] int% length
)
public void GetTextRangeFromNodes(
    ContextNodeCollection subTree,
    /** @attribute OutAttribute */ /** @ref */int start,
    /** @attribute OutAttribute */ /** @ref */int length
)
public function GetTextRangeFromNodes(
    subTree : ContextNodeCollection, 
    start : int, 
    length : int
)

매개 변수

  • start
    형식: System.Int32%
    텍스트 범위의 시작 위치입니다.
  • length
    형식: System.Int32%
    텍스트 범위의 길이입니다.

설명

subTree에 LineNode의 하위 항목이 아닌 ContextNode 개체가 들어 있으면 ArgumentException 예외가 throw됩니다.

subTree에 연속되지 않은 여러 ContextNode 개체가 들어 있으면 모든 ContextNode 개체를 포함하는 가장 작은 텍스트 범위가 반환됩니다.

예제

다음 예제에서는 InkWordNode인 inkWord를 받아 해당 ParentNodeLineNode인지 확인합니다. 확인에 성공하면 GetRecognizedString의 값을 TextBox인 selectedResultsTextBox에 저장하고 inkWord에 해당하는 텍스트를 선택합니다.

Dim parentNode As ContextNode = inkWord.ParentNode
If TypeOf parentNode Is LineNode Then
    Dim parentLine As LineNode = CType(parentNode, LineNode)
    ' Put parent line's recognized string into the text box
    selectedResultsTextBox.Text = parentLine.GetRecognizedString()

    ' Select the text that corresponds to the ink word
    Dim subNodes As New ContextNodeCollection(theInkAnalyzer)
    subNodes.Add(inkWord)
    Dim start As Integer
    Dim length As Integer
    parentLine.GetTextRangeFromNodes(subNodes, start, length)
    If start >= 0 AndAlso length > 0 Then
        selectedResultsTextBox.Select(start, length)
    End If
End If
                    ContextNode parentNode = inkWord.ParentNode;
                    if (parentNode is LineNode)
                    {
                        LineNode parentLine = (LineNode)parentNode;
                        // Put parent line's recognized string into the text box
                        selectedResultsTextBox.Text = parentLine.GetRecognizedString();

                        // Select the text that corresponds to the ink word
                        ContextNodeCollection subNodes = new ContextNodeCollection(theInkAnalyzer);
                        subNodes.Add(inkWord);
                        int start = 0;
                        int length = 0;
                        parentLine.GetTextRangeFromNodes(subNodes, out start, out length);
                        if (start >= 0 && length > 0)
                        {
                            selectedResultsTextBox.Select(start, length);
                        }
                    }

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

LineNode 클래스

LineNode 멤버

Microsoft.Ink 네임스페이스