InkCollector.GetGestureStatus 方法

返回一个值,该值指示 InkCollector 对象是否关注特定应用程序笔势

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Function GetGestureStatus ( _
    gesture As ApplicationGesture _
) As Boolean
用法
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 boolean GetGestureStatus(
    ApplicationGesture gesture
)
public function GetGestureStatus(
    gesture : ApplicationGesture
) : boolean

参数

返回值

类型:System.Boolean
如果 InkCollector 对象不关注特定应用程序笔势,则为 true;否则为 false。

备注

识别笔势时,将引发 Gesture 事件。

如果 gesture 参数设置为 ApplicationGesture,则此方法将引发异常。

若要设置 InkCollector 对象识别特定笔势,请调用 InkCollector.SetGestureStatus 方法。

备注

默认情况下,InkCollector 对象不关注任何应用程序笔势。

示例

此 C# 示例创建一个 ArrayList,其中包含 InkCollector 对象 theInkCollector 关注的所有应用程序笔势。

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));
}

此 Microsoft Visual Basic .NET 示例创建一个 ArrayList,其中包含 InkCollector 对象 theInkCollector 关注的所有应用程序笔势。

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

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkCollector 类

InkCollector 成员

Microsoft.Ink 命名空间

ApplicationGesture

InkCollector.Gesture

InkCollector.SetGestureStatus