Compartilhar via


RealTimeStylus.GetTabletPropertyDescriptionCollection Method

RealTimeStylus.GetTabletPropertyDescriptionCollection Method

Returns the TabletPropertyDescriptionCollection collection that is associated with a given tablet context identifier.

Definition

Visual Basic .NET Public Function GetTabletPropertyDescriptionCollection( _
ByVal tabletContextId As Integer _
) As TabletPropertyDescriptionCollection
C# public TabletPropertyDescriptionCollection GetTabletPropertyDescriptionCollection(
int tabletContextId
);
Managed C++ public: TabletPropertyDescriptionCollection* GetTabletPropertyDescriptionCollection(
int *tabletContextId
);

Parameters

tabletContextId System.Int32. The tablet context for which to retrieve the packet properties

Return Value

Microsoft.Ink.TabletPropertyDescriptionCollection. The TabletPropertyDescriptionCollection collection that is associated with a given tablet context identifier.

Exceptions

ArgumentException Leave Site: Tablet needs to be associated with RTS
COMException Leave Site:
InvalidOperationException Leave Site: OutOfOrderCall: RTS has not yet been enabled so the tablet info is not yet available
ObjectDisposedException Leave Site: The object is already disposed.

Examples

This Microsoft® Visual C#® .NET example is a snippet from the implementation of the IStylusAsyncPlugin interface's TabletAdded method. The form which implements the IStylusAsyncPlugin interface contains a TextBox Leave Site object, theTextBox. The TabletAdded method displays information about the tablet that was added, calls the GetTabletContextIDFromTablet method to get the tablet's context identifier, and calls the GetTabletPropertyDescriptionCollection method to get the list of packet properties supported by the tablet.

[C#]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)
    {
        // ...
    }
}

See Also