Compartir a través de


ContextNode.Strokes Property

Gets the Strokes associated with this ContextNode.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in microsoft.ink.analysis.dll)

Syntax

'Declaration
Public ReadOnly Property Strokes As Strokes
'Usage
Dim instance As ContextNode
Dim value As Strokes

value = instance.Strokes
public Strokes Strokes { get; }
public:
property Strokes^ Strokes {
    Strokes^ get ();
}
/** @property */
public Strokes get_Strokes ()
public function get Strokes () : Strokes
Not applicable.

Property Value

The Strokes associated with this ContextNode.

Remarks

If the ContextNode is not a leaf node, this property returns the strokes of all its leaf descendants.

If the node is of a type that does not have strokes, such as TextWordNode, ImageNode, or AnalysisHintNode, this property returns an empty strokes collection.

Example

This example is a method that assigns a red DrawingAttributes to the strokes of a ContextNode and assigns the default drawing attributes to all other strokes. An InkCollector, theInkCollector, which was attached to a Panel, theNotePanel, collected the strokes.

Private Sub MarkNodeAsRed(ByVal selectedNode As ContextNode)
    ' Set all node strokes to black, but this one to red
    Dim inkStroke As Stroke
    For Each inkStroke In Me.theInkCollector.Ink.Strokes
        If Not (selectedNode Is Nothing) AndAlso _
           selectedNode.Strokes.Contains(inkStroke) Then
            inkStroke.DrawingAttributes = New DrawingAttributes(Color.Red)
        Else
            inkStroke.DrawingAttributes = Me.theInkCollector.DefaultDrawingAttributes
        End If
    Next inkStroke
    theNotesPanel.Refresh()

End Sub 'MarkNodeAsRed
private void MarkNodeAsRed(ContextNode selectedNode)
{
    // Set all node strokes to black, but this one to red
    foreach (Stroke stroke in this.theInkCollector.Ink.Strokes)
    {
        if (selectedNode != null && 
            selectedNode.Strokes.Contains(stroke))
            stroke.DrawingAttributes = new DrawingAttributes(Color.Red);
        else
            stroke.DrawingAttributes = this.theInkCollector.DefaultDrawingAttributes;
    }

    theNotesPanel.Refresh();
}

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

ContextNode Class
ContextNode Members
Microsoft.Ink Namespace
Microsoft.Ink.Strokes