Share via


GestureRecognizer.Reset Method

GestureRecognizer.Reset Method

Clears the GestureRecognizer of past stroke information.

Definition

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

Exceptions

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

Examples

This Microsoft® Visual C#® .NET example is a snippet from a menu item's Click Leave Site event handler. When the MenuItem Leave Site object, theMenuItemMultistroke, is checked, the GestureRecognizer object, theGestureRecognizer, is set to recognize multistroke gestures. When theMenuItemMultistroke is unchecked, theGestureRecognizer is set to recognize single-stroke gestures. Then the Reset method is called to clear theGestureRecognizer of old stroke information.

[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 Multistroke menu item's Click event handler.
private void theMenuItemMultistroke_Click(object sender, System.EventArgs e)
{
    // Update the Multistroke menu item's checked state.
    this.theMenuItemMultistroke.Checked = !this.theMenuItemMultistroke.Checked;

    // Update the maximum stroke count for and reset gesture recognition.
    this.theGestureRecognizer.MaxStrokeCount =
        (this.theMenuItemMultistroke.Checked) ? 2 : 1;
    this.theGestureRecognizer.Reset();
}