Freigeben über


InkAnalyzer.FindNodesOfType-Methode (Guid)

Gibt alle ContextNode-Objekte des angegebenen Typs zurück.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

Syntax

'Declaration
Public Function FindNodesOfType ( _
    type As Guid _
) As ContextNodeCollection
'Usage
Dim instance As InkAnalyzer
Dim type As Guid
Dim returnValue As ContextNodeCollection

returnValue = instance.FindNodesOfType(type)
public ContextNodeCollection FindNodesOfType(
    Guid type
)
public:
ContextNodeCollection^ FindNodesOfType(
    Guid type
)
public ContextNodeCollection FindNodesOfType(
    Guid type
)
public function FindNodesOfType(
    type : Guid
) : ContextNodeCollection

Parameter

Rückgabewert

Typ: Microsoft.Ink.ContextNodeCollection
Eine ContextNodeCollection, die alle ContextNode-Objekte des angegebenen Typs enthält, die in der Knotenstruktur von InkAnalyzer enthalten sind.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie alle LineNode-Objekte in einem InkAnalyzer, theInkAnalyzer, durchlaufen werden. In jeder Zeile werden alle InkWordNode-Objekte durchlaufen, und wenn zwei Freihandwortknoten als dasselbe Wort erkannt werden, werden sie rot markiert.

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

Plattformen

Windows Vista

.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.

Versionsinformationen

.NET Framework

Unterstützt in: 3.0

Siehe auch

Referenz

InkAnalyzer-Klasse

InkAnalyzer-Member

FindNodesOfType-Überladung

Microsoft.Ink-Namespace

InkAnalyzer.FindInkLeafNodes

InkAnalyzer.FindLeafNodes

InkAnalyzer.FindNode

InkAnalyzer.FindNodes