Share via


RealTimeStylus.ClearStylusQueues Method

RealTimeStylus.ClearStylusQueues Method

Clears the stylus queues.

Definition

Visual Basic .NET Public Sub ClearStylusQueues()
C# public void ClearStylusQueues();
Managed C++ public: void ClearStylusQueues();

Exceptions

COMException Leave Site:
ObjectDisposedException Leave Site: The RealTimeStylus object is disposed.

Examples

This Microsoft® Visual C#® .NET example is a snippet from a form's Closed Leave Site event handler, which disables the RealTimeStylus, GestureRecognizer, and DynamicRenderer objects, empties the RealTimeStylus objects' queues, and calls the Dispose method of the objects.

[C#]using Microsoft.Ink;
using Microsoft.StylusInput;
using Microsoft.StylusInput.PluginData;

// ...

// Declare the RealTimeStylus objects, the GestureRecognizer plugin,
// and the DynamicRenderer plug-in.
private Microsoft.StylusInput.RealTimeStylus thePrimaryRealTimeStylus = null;
private Microsoft.StylusInput.RealTimeStylus theSecondaryRealTimeStylus = null;
private Microsoft.StylusInput.GestureRecognizer theGestureRecognizer = null;
private Microsoft.StylusInput.DynamicRenderer theDynamicRenderer = null;

// ...

// The form's Closed event handler.
private void theForm_Closed(object sender, System.EventArgs e)
{
    // Disable the RealTimeStylus and the appropriate plug-ins.
    this.thePrimaryRealTimeStylus.Enabled = false;
    this.theGestureRecognizer.Enabled = false;
    this.theDynamicRenderer.Enabled = false;

    // Empty the RealTimeStylus queues
    this.thePrimaryRealTimeStylus.ClearStylusQueues();
    this.theSecondaryRealTimeStylus.ClearStylusQueues();

    // Dispose of the the RealTimeStylus objects and appropriate plug-ins.
    this.thePrimaryRealTimeStylus.Dispose();
    this.thePrimaryRealTimeStylus = null;
    this.theSecondaryRealTimeStylus.Dispose();
    this.theSecondaryRealTimeStylus = null;
    this.theDynamicRenderer.Dispose();
    this.theDynamicRenderer = null;
    this.theGestureRecognizer.Dispose();
    this.theGestureRecognizer = null;
}