RealTimeStylus.GetTabletPropertyDescriptionCollection 方法

返回与给定的 Tablet 上下文标识符关联的 TabletPropertyDescriptionCollection 集合。

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

语法

声明
Public Function GetTabletPropertyDescriptionCollection ( _
    tabletContextId As Integer _
) As TabletPropertyDescriptionCollection
用法
Dim instance As RealTimeStylus
Dim tabletContextId As Integer
Dim returnValue As TabletPropertyDescriptionCollection

returnValue = instance.GetTabletPropertyDescriptionCollection(tabletContextId)
public TabletPropertyDescriptionCollection GetTabletPropertyDescriptionCollection(
    int tabletContextId
)
public:
TabletPropertyDescriptionCollection^ GetTabletPropertyDescriptionCollection(
    int tabletContextId
)
public TabletPropertyDescriptionCollection GetTabletPropertyDescriptionCollection(
    int tabletContextId
)
public function GetTabletPropertyDescriptionCollection(
    tabletContextId : int
) : TabletPropertyDescriptionCollection

参数

  • tabletContextId
    类型:System.Int32
    希望获取其数据包属性说明的 Tablet 对象的 Tablet 上下文标识符。

返回值

类型:Microsoft.Ink.TabletPropertyDescriptionCollection
与给定的 Tablet 上下文标识符关联的 TabletPropertyDescriptionCollection 集合。

备注

当禁用或释放 RealTimeStylus 时此方法将引发异常。

示例

此 C# 示例是 IStylusAsyncPlugin 接口的 TabletAdded 方法实现中的代码段。实现 IStylusAsyncPlugin 接口的窗体包含一个 TextBox 对象 theTextBox。TabletAdded 方法显示有关所添加的 Tablet 的信息,调用 GetTabletContextIdFromTablet 方法以获取 Tablet 的上下文标识符,并调用 GetTabletPropertyDescriptionCollection 方法以获取 Tablet 支持的数据包属性的列表。

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;

// ...

// Called when a tablet is added while the RealTimeStylus is enabled.
public void TabletAdded(RealTimeStylus sender, TabletAddedData data)
{
    // Display information about the tablet that was added.
    int theContextId =
        this.thePrimaryRealTimeStylus.GetTabletContextIdFromTablet(data.Tablet);

    this.theTextBox.Text = string.Format(
        "Tablet added, Name = {0}, ContextId={1}, available packet properties:"
        + Environment.NewLine, data.Tablet.Name, theContextId);

    TabletPropertyDescriptionCollection theTabletProperties =
        this.thePrimaryRealTimeStylus.GetTabletPropertyDescriptionCollection(theContextId);

    foreach(TabletPropertyDescription theTabletPropertyDescription in theTabletProperties)
    {
        // ...
    }
}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

RealTimeStylus 类

RealTimeStylus 成员

Microsoft.StylusInput 命名空间

Microsoft.Ink.TabletPropertyDescriptionCollection

RealTimeStylus.GetTabletContextIdFromTablet

RealTimeStylus.GetTabletFromTabletContextId

Stylus.TabletContextId