ContextNodeCollection 클래스
업데이트: 2007년 11월
잉크 분석의 결과인 ContextNode 개체 컬렉션을 포함합니다.
네임스페이스: Microsoft.Ink
어셈블리: Microsoft.Ink.Analysis(Microsoft.Ink.Analysis.dll)
구문
‘선언
Public Class ContextNodeCollection _
Implements ICollection, IEnumerable
‘사용 방법
Dim instance As ContextNodeCollection
public class ContextNodeCollection : ICollection,
IEnumerable
public ref class ContextNodeCollection : ICollection,
IEnumerable
public class ContextNodeCollection implements ICollection,
IEnumerable
public class ContextNodeCollection implements ICollection, IEnumerable
예제
다음 예제에서는 InkAnalyzer에서 ContextNodeCollection을 순환 검색하는 방법을 보여 줍니다. 이는 InkAnalyzer인 theInkAnalyzer의 FindNodesOfType(ContextNodeType, ContextNode) 메서드입니다. 또한 모든 줄 노드를 순환 검색하고 두 개의 잉크 단어 노드가 같은 단어로 존재하면 해당 노드를 빨간색으로 표시합니다.
' If two identical ink words occur next to each other, mark them as red.
' Note: This doesn't actually look for pairs that go across two lines.
Dim lines As ContextNodeCollection = _
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.Line)
Dim lineNode As ContextNode
Dim stroke As Stroke
For Each lineNode In lines
Dim previousWord As InkWordNode = Nothing
Dim inkWord As InkWordNode
For Each inkWord In _
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkWord, lineNode)
If Not (previousWord Is Nothing) AndAlso _
previousWord.GetRecognizedString() = inkWord.GetRecognizedString() Then
For Each stroke In previousWord.Strokes
stroke.DrawingAttributes = New DrawingAttributes(Color.Red)
Next stroke
For Each stroke In inkWord.Strokes
stroke.DrawingAttributes = New DrawingAttributes(Color.Red)
Next stroke
End If
previousWord = inkWord
Next inkWord
Next lineNode
// If two identical ink words occur next to each other, mark them as red.
// Note: This doesn't actually look for pairs that go across two lines.
ContextNodeCollection lines =
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.Line);
foreach (ContextNode lineNode in lines)
{
InkWordNode previousWord = null;
foreach (InkWordNode inkWord in
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkWord, lineNode))
{
if (previousWord != null &&
previousWord.GetRecognizedString() == inkWord.GetRecognizedString())
{
foreach (Stroke stroke in previousWord.Strokes)
stroke.DrawingAttributes = new DrawingAttributes(Color.Red);
foreach (Stroke stroke in inkWord.Strokes)
stroke.DrawingAttributes = new DrawingAttributes(Color.Red);
}
previousWord = inkWord;
}
}
상속 계층 구조
System.Object
Microsoft.Ink.ContextNodeCollection
스레드로부터의 안전성
이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원
참고 항목
참조
FindNodes(MatchesCriteriaCallBack, Object, ContextNode)