Поделиться через


InkAnalyzer.FindNodesOfType - метод (Guid, ContextNode)

Обновлен: Ноябрь 2007

Returns the ContextNode objects of the specified type that are descendants of the specified ContextNode.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink.Analysis (в Microsoft.Ink.Analysis.dll)

Синтаксис

'Декларация
Public Function FindNodesOfType ( _
    type As Guid, _
    node As ContextNode _
) As ContextNodeCollection
'Применение
Dim instance As InkAnalyzer
Dim type As Guid
Dim node As ContextNode
Dim returnValue As ContextNodeCollection

returnValue = instance.FindNodesOfType(type, _
    node)
public ContextNodeCollection FindNodesOfType(
    Guid type,
    ContextNode node
)
public:
ContextNodeCollection^ FindNodesOfType(
    Guid type, 
    ContextNode^ node
)
public ContextNodeCollection FindNodesOfType(
    Guid type,
    ContextNode node
)
public function FindNodesOfType(
    type : Guid, 
    node : ContextNode
) : ContextNodeCollection

Параметры

Возвращаемое значение

Тип: Microsoft.Ink.ContextNodeCollection
The ContextNode objects of the specified type that are descendants of the specified ContextNode.

Примеры

The following example shows how to loop through all the LineNode objects in an InkAnalyzer, theInkAnalyzer. In each line, it loops through all InkWordNode objects and, if there are two ink word nodes that are recognized as the same word, it marks them as red.

' 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;
                }
            }

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

InkAnalyzer Класс

InkAnalyzer - члены

FindNodesOfType - перегрузка

Microsoft.Ink - пространство имен

InkAnalyzer.FindInkLeafNodes

InkAnalyzer.FindLeafNodes

InkAnalyzer.FindNode

InkAnalyzer.FindNodes