Metodo InkAnalyzer.FindNodesOfType (Guid)
Aggiornamento: novembre 2007
Restituisce un oggetto ContextNodeCollection contenente tutti gli oggetti ContextNode del tipo specificato.
Spazio dei nomi: System.Windows.Ink
Assembly: IAWinFX (in IAWinFX.dll)
Sintassi
'Dichiarazione
Public Function FindNodesOfType ( _
type As Guid _
) As ContextNodeCollection
'Utilizzo
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
Parametri
- type
Tipo: System.Guid
Valore restituito
Tipo: System.Windows.Ink.ContextNodeCollection
Oggetto ContextNodeCollection contenente tutti gli oggetti ContextNode del tipo specificato che sono memorizzati nella struttura ad albero dei nodi di InkAnalyzer.
Esempi
Nell'esempio seguente viene illustrato come riprodurre a ciclo continuo tutti gli oggetti LineNode di un oggetto InkAnalyzer denominato theInkAnalyzer. Per ogni riga, vengono riprodotti a ciclo continuo tutti gli oggetti InkWordNode e se vengono riconosciuti due nodi inkWord con la stessa parola, questi vengono contrassegnati in rosso.
' 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(ContextNodeType.Line)
Dim lineNode As ContextNode
For Each lineNode In lines
Dim previousWord As InkWordNode = Nothing
For Each inkWord As InkWordNode In _
theInkAnalyzer.FindNodesOfType(ContextNodeType.InkWord, lineNode)
If Not (previousWord Is Nothing) AndAlso _
previousWord.GetRecognizedString() = inkWord.GetRecognizedString() Then
For Each stroke As Stroke In previousWord.Strokes
stroke.DrawingAttributes.Color = Colors.Red
Next stroke
For Each stroke As Stroke In inkWord.Strokes
stroke.DrawingAttributes.Color = Colors.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(ContextNodeType.Line);
foreach (ContextNode lineNode in lines)
{
InkWordNode previousWord = null;
foreach (InkWordNode inkWord in
theInkAnalyzer.FindNodesOfType(ContextNodeType.InkWord, lineNode))
{
if (previousWord != null &&
previousWord.GetRecognizedString() == inkWord.GetRecognizedString())
{
foreach (Stroke stroke in previousWord.Strokes)
stroke.DrawingAttributes.Color = Colors.Red;
foreach (Stroke stroke in inkWord.Strokes)
stroke.DrawingAttributes.Color = Colors.Red;
}
previousWord = inkWord;
}
}
Piattaforme
Windows Vista
.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.
Informazioni sulla versione
.NET Framework
Supportato in: 3.0