Share via


InkCollector.GetGestureStatus Method

Returns a value that indicates whether the InkCollector object has interest in a particular application gesture.

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

Syntax

'Declaration
Public Function GetGestureStatus ( _
    gesture As ApplicationGesture _
) As Boolean
'Usage
Dim instance As InkCollector 
Dim gesture As ApplicationGesture 
Dim returnValue As Boolean 

returnValue = instance.GetGestureStatus(gesture)
public bool GetGestureStatus(
    ApplicationGesture gesture
)
public:
bool GetGestureStatus(
    ApplicationGesture gesture
)
public function GetGestureStatus(
    gesture : ApplicationGesture
) : boolean

Parameters

Return Value

Type: System.Boolean
true if the InkCollector object has interest in a particular application gesture; otherwise, false.

Remarks

The Gesture event is raised when the gesture is recognized.

This method throws an exception if the gesture parameter is set to ApplicationGesture.

To set interest of the InkCollector object for a particular gesture, call the InkCollector.SetGestureStatus method.

Note

By default, the InkCollector object does not have interest in any application gesture.

Examples

This C# example creates an ArrayList that contains all application gestures for which an InkCollector object, theInkCollector, has interest.

using Microsoft.Ink;
// . . .
// Return an array of all of the ApplicationGestures that
// have their status set to true on the InkCollector object.
private ApplicationGesture [] GetSetAppGestures(InkCollector theInkCollector)
{
    ArrayList result = new ArrayList();
    Array gestureArray = System.Enum.GetValues(typeof(ApplicationGesture));
    foreach (ApplicationGesture theGesture in gestureArray)
    {
        // ApplicationGesture.AllGestures is not a meaningful gesture
        // to pass to GetGestureStatus()
        if (theGesture != ApplicationGesture.AllGestures && 
            theInkCollector.GetGestureStatus(theGesture))
        {
            result.Add(theGesture);
        }
    }
    return (ApplicationGesture[])result.ToArray(typeof(ApplicationGesture));
}

This Microsoft Visual Basic .NET example creates an ArrayList that contains all application gestures for which an InkCollector object, theInkCollector, has interest.

Imports Microsoft.Ink
' . . .
' Return an array of all of the ApplicationGestures that
' have their status set to true on the InkCollector object.
Private Function GetSetAppGestures(ByVal theInkCollector As InkCollector) As ApplicationGesture()
    Dim result As New ArrayList()
    Dim sampleGesture As ApplicationGesture = ApplicationGesture.NoGesture
    Dim theGestures As Array = System.Enum.GetValues(sampleGesture.GetType())
    Dim theGesture As ApplicationGesture
    For Each theGesture In theGestures
        ' ApplicationGesture.AllGestures is not a meaningful 
        ' gesture to pass to GetGestureStatus()
        If (Not theGesture.Equals(ApplicationGesture.AllGestures)) AndAlso _
            theInkCollector.GetGestureStatus(theGesture) Then
            result.Add(theGesture)
        End If
    Next
    Return CType(result.ToArray(test.GetType()), ApplicationGesture())
End Function

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

InkCollector Class

InkCollector Members

Microsoft.Ink Namespace

ApplicationGesture

InkCollector.Gesture

InkCollector.SetGestureStatus