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 ();
}
public function get Strokes () : Strokes
Property Value
Type: Microsoft.Ink.Strokes
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.
Examples
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 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0