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
參數
- gesture
型別:Microsoft.Ink.ApplicationGesture
ApplicationGesture 列舉型別的成員,表示要查詢的筆勢。
傳回值
型別: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