InkAnalyzer.FindNodesOfType, méthode (Guid)
Mise à jour : November 2007
Retourne un ContextNodeCollection qui contient l'ensemble des objets ContextNode du type spécifié.
Espace de noms : System.Windows.Ink
Assembly : IAWinFX (dans IAWinFX.dll)
Syntaxe
'Déclaration
Public Function FindNodesOfType ( _
type As Guid _
) As ContextNodeCollection
'Utilisation
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
Paramètres
- type
Type : System.Guid
Valeur de retour
Type : System.Windows.Ink.ContextNodeCollection
ContextNodeCollection contenant tous les objets ContextNode du type spécifié qui sont stockés dans l'arborescence de nœuds du InkAnalyzer.
Exemples
L'exemple suivant montre comment parcourir l'ensemble des objets LineNode dans un InkAnalyzer nommé theInkAnalyzer. À chaque ligne, il parcourt l'ensemble des objets InkWordNode et les marque en rouge si deux nœuds inkWord sont reconnus comme un même mot.
' 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;
}
}
Plateformes
Windows Vista
Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Informations de version
.NET Framework
Pris en charge dans : 3.0