다음을 통해 공유


CustomRecognizerNode.GetNodesFromTextRange 메서드 (Int32%, Int32%, ContextNodeCollection)

업데이트: 2007년 11월

하위 노드의 컬렉션 내에서 인식된 문자열의 지정된 텍스트 범위와 관련된 하위 ContextNode 개체의 컬렉션을 반환합니다.

네임스페이스:  System.Windows.Ink
어셈블리:  IAWinFX(IAWinFX.dll)

구문

‘선언
Public Function GetNodesFromTextRange ( _
    ByRef start As Integer, _
    ByRef length As Integer, _
    subTree As ContextNodeCollection _
) As ContextNodeCollection
‘사용 방법
Dim instance As CustomRecognizerNode
Dim start As Integer
Dim length As Integer
Dim subTree As ContextNodeCollection
Dim returnValue As ContextNodeCollection

returnValue = instance.GetNodesFromTextRange(start, _
    length, subTree)
public ContextNodeCollection GetNodesFromTextRange(
    ref int start,
    ref int length,
    ContextNodeCollection subTree
)
public:
ContextNodeCollection^ GetNodesFromTextRange(
    int% start, 
    int% length, 
    ContextNodeCollection^ subTree
)
public ContextNodeCollection GetNodesFromTextRange(
    /** @ref */int start,
    /** @ref */int length,
    ContextNodeCollection subTree
)
public function GetNodesFromTextRange(
    start : int, 
    length : int, 
    subTree : ContextNodeCollection
) : ContextNodeCollection

매개 변수

반환 값

형식: System.Windows.Ink.ContextNodeCollection
하위 노드의 컬렉션 내에서 인식된 문자열의 지정된 텍스트 범위와 관련된 하위 ContextNode 개체의 컬렉션입니다.

설명

지정된 텍스트 범위는 전체 [T:System.Windows.Ink. CustomRecognizerNode]의 인식된 문자열 또는 전체 RootNode가 아니라 이 CustomRecognizerNode에서 인식된 문자열의 subTree 부분에 해당합니다.

start 및 length 매개 변수의 값은 변경될 수 있으므로 이러한 매개 변수는 참조입니다. 예를 들어 GetRecognizedString의 반환 값이 "I am late"이고 문자 "a"에 해당하는 start = 6 및 length = 1의 값을 전달하면 ContextNodeCollection에는 하나의 ContextNode만 들어 있을 가능성이 높습니다. 이 ContextNode는 단어 "late"에 해당하는 InkWordNode입니다. 이 경우 start의 값은 5로 변경되고 length의 값은 4로 변경(단어 "late"의 길이)됩니다.

참고start 매개 변수는 subTree 매개 변수의 노드에 해당합니다. 이전 예제에서 "I"가 아닌 "am" 및 "late"에 대한 노드가 포함된 subTree 매개 변수를 전달하는 경우 "late"라는 단어의 텍스트 범위는 start 매개 변수가 3이고 길이가 4입니다.

예제

다음 예제에서는 이름이 customRecognizer인 CustomRecognizerNode의 마지막 줄에 해당하는 ContextNode 개체 하나가 들어 있는 lastLineCollection이라는 ContextNodeCollection 개체를 사용합니다. 그런 다음 마지막 줄의 선택된 텍스트에 해당하는 Strokes를 빨간색으로 변경하고 나머지 스트로크는 모두 검정색으로 표시합니다.

' Get the nodes that correspond to this start and length
Dim selectedNodes As ContextNodeCollection = _
    customRecognizer.GetNodesFromTextRange(start, length, lastLineCollection)

' Set all strokes to black
For Each stroke As Stroke In customRecognizer.Strokes
    stroke.DrawingAttributes.Color = Colors.Black
Next stroke
' Set strokes in the collection to red
For Each node As ContextNode In selectedNodes
    For Each stroke As Stroke In node.Strokes
        stroke.DrawingAttributes.Color = Colors.Red
    Next stroke
Next node
// Get the nodes that correspond to this start and length
ContextNodeCollection selectedNodes =
    customRecognizer.GetNodesFromTextRange(ref start, ref length, lastLineCollection);

// Set all strokes to black
foreach (Stroke stroke in customRecognizer.Strokes)
    stroke.DrawingAttributes.Color = Colors.Black;

// Set strokes in the collection to red
foreach (ContextNode node in selectedNodes)
{
    foreach (Stroke stroke in node.Strokes)
    {
        stroke.DrawingAttributes.Color = Colors.Red;
    }
}

플랫폼

Windows Vista

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

CustomRecognizerNode 클래스

CustomRecognizerNode 멤버

GetNodesFromTextRange 오버로드

System.Windows.Ink 네임스페이스