Share via


Tablet.IsPacketPropertySupported 方法

返回一个值,表示此 Tablet 对象是否支持标有全局唯一标识符 (GUID) 的 PacketProperty 字段。

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

语法

声明
Public Function IsPacketPropertySupported ( _
    id As Guid _
) As Boolean
用法
Dim instance As Tablet
Dim id As Guid
Dim returnValue As Boolean

returnValue = instance.IsPacketPropertySupported(id)
public bool IsPacketPropertySupported(
    Guid id
)
public:
bool IsPacketPropertySupported(
    Guid id
)
public boolean IsPacketPropertySupported(
    Guid id
)
public function IsPacketPropertySupported(
    id : Guid
) : boolean

参数

返回值

类型:System.Boolean
返回一个值,表示此 Tablet 对象是否支持标有全局唯一标识符 (GUID) 的 PacketProperty 字段。

含义

true

Tablet 对象支持 PacketProperty 字段。

false

Tablet 对象不支持 PacketProperty 字段。

备注

此方法确定 Tablet 对象是否支持 PacketProperty 类的各个字段。

备注

如果在某些消息处理程序内调用此函数,则可以重新进入此函数,从而导致意外的结果。在处理以下任一消息时,请注意避免可重入调用:WM_ACTIVATEWM_ACTIVATEAPPWM_NCACTIVATEWM_PAINTWM_SYSCOMMAND(如果 wParam 设置为 SC_HOTKEY 或 SC_TASKLIST);以及 WM_SYSKEYDOWN(处理 Alt-Tab 或 Alt-Esc 组合键时)。这是单线程单元模型应用程序的问题。

示例

此示例将会报告对于 Tablets 集合的默认 Tablet 对象,有哪些 PacketProperty 字段可用。

Private Function Report_Properties_DefaultTablet() As String

    Dim SB As StringBuilder = New StringBuilder(1024)
    Dim defTablet As Tablet = New Tablets().DefaultTablet

    ' Generate a report on which PacketProperties are supported by the default tablet.
    SB.AppendLine("Packet Properties supported by the default tablet: " + defTablet.Name)

    If defTablet.IsPacketPropertySupported(PacketProperty.AltitudeOrientation) Then
        SB.AppendLine("AltitudeOrientation: YES")
    Else
        SB.AppendLine("AltitudeOrientation: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.AzimuthOrientation) Then
        SB.AppendLine("AzimuthOrientation: YES")
    Else
        SB.AppendLine("AzimuthOrientation: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.ButtonPressure) Then
        SB.AppendLine("ButtonPressure: YES")
    Else
        SB.AppendLine("ButtonPressure: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.NormalPressure) Then
        SB.AppendLine("NormalPressure: YES")
    Else
        SB.AppendLine("NormalPressure: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.PacketStatus) Then
        SB.AppendLine("PacketStatus: YES")
    Else
        SB.AppendLine("PacketStatus: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.PitchRotation) Then
        SB.AppendLine("PitchRotation: YES")
    Else
        SB.AppendLine("PitchRotation: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.RollRotation) Then
        SB.AppendLine("RollRotation: YES")
    Else
        SB.AppendLine("RollRotation: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.SerialNumber) Then
        SB.AppendLine("SerialNumber: YES")
    Else
        SB.AppendLine("SerialNumber: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.TangentPressure) Then
        SB.AppendLine("TangentPressure: YES")
    Else
        SB.AppendLine("TangentPressure: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.TimerTick) Then
        SB.AppendLine("TimerTick: YES")
    Else
        SB.AppendLine("TimerTick: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.TwistOrientation) Then
        SB.AppendLine("TwistOrientation: YES")
    Else
        SB.AppendLine("TwistOrientation: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.X) Then
        SB.AppendLine("X: YES")
    Else
        SB.AppendLine("X: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.XTiltOrientation) Then
        SB.AppendLine("XTiltOrientation: YES")
    Else
        SB.AppendLine("XTiltOrientation: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.Y) Then
        SB.AppendLine("Y: YES")
    Else
        SB.AppendLine("Y: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.YawRotation) Then
        SB.AppendLine("YawRotation: YES")
    Else
        SB.AppendLine("YawRotation: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.YTiltOrientation) Then
        SB.AppendLine("YTiltOrientation: YES")
    Else
        SB.AppendLine("YTiltOrientation: NO")
    End If

    If defTablet.IsPacketPropertySupported(PacketProperty.Z) Then
        SB.AppendLine("Z: YES")
    Else
        SB.AppendLine("Z: NO")
    End If

    Return SB.ToString

End Function
public string Report_Properties_DefaultTablet()
{
    StringBuilder SB = new StringBuilder(1024);

    Tablet defTablet = new Tablets().DefaultTablet;
    // Generate a report on which PacketProperties are supported by the default tablet.
    SB.AppendLine("Packet Properties supported by the default tablet: " + defTablet.Name);
    SB.AppendLine("AltitudeOrientation: " + ((defTablet.IsPacketPropertySupported(PacketProperty.AltitudeOrientation)) ? "YES" : "NO"));
    SB.AppendLine("AzimuthOrientation: " + ((defTablet.IsPacketPropertySupported(PacketProperty.AzimuthOrientation)) ? "YES" : "NO"));
    SB.AppendLine("ButtonPressure: " + ((defTablet.IsPacketPropertySupported(PacketProperty.ButtonPressure)) ? "YES" : "NO"));
    SB.AppendLine("NormalPressure: " + ((defTablet.IsPacketPropertySupported(PacketProperty.NormalPressure)) ? "YES" : "NO"));
    SB.AppendLine("PacketStatus: " + ((defTablet.IsPacketPropertySupported(PacketProperty.PacketStatus)) ? "YES" : "NO"));
    SB.AppendLine("PitchRotation: " + ((defTablet.IsPacketPropertySupported(PacketProperty.PitchRotation)) ? "YES" : "NO"));
    SB.AppendLine("RollRotation: " + ((defTablet.IsPacketPropertySupported(PacketProperty.RollRotation)) ? "YES" : "NO"));
    SB.AppendLine("SerialNumber: " + ((defTablet.IsPacketPropertySupported(PacketProperty.SerialNumber)) ? "YES" : "NO"));
    SB.AppendLine("TangentPressure: " + ((defTablet.IsPacketPropertySupported(PacketProperty.TangentPressure)) ? "YES" : "NO"));
    SB.AppendLine("TimerTick: " + ((defTablet.IsPacketPropertySupported(PacketProperty.TimerTick)) ? "YES" : "NO"));
    SB.AppendLine("TwistOrientation: " + ((defTablet.IsPacketPropertySupported(PacketProperty.TwistOrientation)) ? "YES" : "NO"));
    SB.AppendLine("X: " + ((defTablet.IsPacketPropertySupported(PacketProperty.X)) ? "YES" : "NO"));
    SB.AppendLine("XTiltOrientation: " + ((defTablet.IsPacketPropertySupported(PacketProperty.XTiltOrientation)) ? "YES" : "NO"));
    SB.AppendLine("Y: " + ((defTablet.IsPacketPropertySupported(PacketProperty.Y)) ? "YES" : "NO"));
    SB.AppendLine("YawRotation: " + ((defTablet.IsPacketPropertySupported(PacketProperty.YawRotation)) ? "YES" : "NO"));
    SB.AppendLine("YTiltOrientation: " + ((defTablet.IsPacketPropertySupported(PacketProperty.YTiltOrientation)) ? "YES" : "NO"));
    SB.AppendLine("Z: " + ((defTablet.IsPacketPropertySupported(PacketProperty.Z)) ? "YES" : "NO"));
    return SB.ToString();
 }

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

Tablet 类

Tablet 成员

Microsoft.Ink 命名空间

PacketProperty

Stroke.GetPacketData

Stroke.SetPacketValuesByProperty

Tablets.IsPacketPropertySupported