Share via


InkOverlay.CollectingInk Property

Gets a value that specifies whether ink is currently being drawn on an InkOverlay object.

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property CollectingInk As Boolean
'Usage
Dim instance As InkOverlay 
Dim value As Boolean 

value = instance.CollectingInk
[BrowsableAttribute(false)]
public bool CollectingInk { get; }
[BrowsableAttribute(false)]
public:
property bool CollectingInk {
    bool get ();
}
public function get CollectingInk () : boolean

Property Value

Type: System.Boolean
A value that specifies whether ink is currently being drawn on an InkOverlay object.
true if ink is being drawn on the InkOverlay object; otherwise, false.

Remarks

You can use the CollectingInk property to see if ink is being drawn on an InkOverlay object rather than monitoring the Stroke event.

Note

Because ink collection is handled on a separate thread from your application code, the CollectingInk property can change to true while your application code is operating under the assumption that it is still false. To handle this contingency, code that depends upon the value of the CollectingInk property should be contained within a try-catch block.

Examples

In this example, all strokes of the InkOverlay object are selected by setting the Selection property to the same Strokes collection used by the associated Ink object.

After the selection is made, the EditingMode property is set to Select.

The EditingMode property cannot be changed while the object is collecting ink. Because ink collection is handled on a separate thread from your application code, the CollectingInk property can change to true while your application code is operating under the assumption that it is still false. To handle this contingency, access to the EditingMode property should be contained within a try-catch block.

' Select all strokes 
' mInkObject can be InkOverlay or InkPicture 
Try 
    If Not mInkObject.CollectingInk Then
        mInkObject.Selection = mInkObject.Ink.Strokes
        mInkObject.EditingMode = InkOverlayEditingMode.Select 
    End If 

Catch 
    ' handle or rethrow 
End Try
// Select all strokes 
// mInkObject can be InkOverlay or InkPicture 
try
{
    if (!mInkObject.CollectingInk)
    {
        mInkObject.Selection = mInkObject.Ink.Strokes;
        mInkObject.EditingMode = InkOverlayEditingMode.Select;
    }
}
catch
{
    // handle or rethrow
}

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

See Also

Reference

InkOverlay Class

InkOverlay Members

Microsoft.Ink Namespace

InkOverlay.Stroke