Поделиться через


RealTimeStylus.GetTabletFromTabletContextId - метод

Обновлен: Ноябрь 2007

Returns the Tablet object that is associated with a given tablet context identifier.

Пространство имен:  Microsoft.StylusInput
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Function GetTabletFromTabletContextId ( _
    tabletContextId As Integer _
) As Tablet
'Применение
Dim instance As RealTimeStylus
Dim tabletContextId As Integer
Dim returnValue As Tablet

returnValue = instance.GetTabletFromTabletContextId(tabletContextId)
public Tablet GetTabletFromTabletContextId(
    int tabletContextId
)
public:
Tablet^ GetTabletFromTabletContextId(
    int tabletContextId
)
public Tablet GetTabletFromTabletContextId(
    int tabletContextId
)
public function GetTabletFromTabletContextId(
    tabletContextId : int
) : Tablet

Параметры

  • tabletContextId
    Тип: System.Int32
    The tablet context identifier for which you want the associated Tablet object.

Возвращаемое значение

Тип: Microsoft.Ink.Tablet
The Tablet object that is associated with a given tablet context identifier.

Заметки

ms585096.alert_note(ru-ru,VS.90).gifПримечание.

A tablet context identifier is specific to RealTimeStylus object; however two RealTimeStylus objects may have a different context identifiers for the same Tablet object. In addition, a tablet context identifier is only valid while a RealTimeStylus object is enabled. If a RealTimeStylus object is disabled and then re-enabled, the tablet context identifier for each Tablet object may have a different value from when the RealTimeStylus object was first enabled.

This method throws an exception when the RealTimeStylus is disabled or disposed.

ms585096.alert_note(ru-ru,VS.90).gifПримечание.

This function can be re-entered when called within certain message handlers, causing unexpected results. Take care to avoid a reentrant call when handling any of the following messages: WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_PAINT; WM_SYSCOMMAND if wParam is set to SC_HOTKEY or SC_TASKLIST; and WM_SYSKEYDOWN (when processing Alt-Tab or Alt-Esc key combinations). This is an issue with single-threaded apartment model applications.

Примеры

This C# example is a snippet from the implementation of the IStylusAsyncPlugin interface's RealTimeStylusEnabled method. The form which implements the IStylusAsyncPlugin interface contains a TextBox object, theTextBox. The RealTimeStylusEnabled method displays information about the tablets that are available at the time the RealTimeStylus object is enabled.

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 the RealTimeStylus is enabled, or when the plug-in is added to
// a RealTimeStylus that is already enabled.
public void RealTimeStylusEnabled(RealTimeStylus sender,
    RealTimeStylusEnabledData data)
{
    // Display the list of available tablets.
    this.theTextBox.Text = string.Format(
        "RealTimeStylus enabled ({0} tablets attached):" + Environment.NewLine,
        data.Count);
    foreach (int theContextId in data)
    {
        Tablet theTablet =
            this.thePrimaryRealTimeStylus.GetTabletFromTabletContextId(theContextId);

        this.theTextBox.Text += string.Format(
            "  ContextId = {0}, Tablet.Name = {1}" + Environment.NewLine,
            theContextId, theTablet.Name);

        this.theTextBox.Text += "   Available packet properties:" + Environment.NewLine;

        foreach(TabletPropertyDescription theTabletPropertyDescription in
            this.thePrimaryRealTimeStylus.GetTabletPropertyDescriptionCollection(theContextId))
        {
            this.theTextBox.Text += string.Format("    {0}" + Environment.NewLine,
                this.GetPacketPropertyNameFromGuid(theTabletPropertyDescription.PacketPropertyId));
        }
    }
}

Платформы

Windows Vista, Windows XP с пакетом обновления 2 (SP2), Windows Server 2003

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

RealTimeStylus Класс

RealTimeStylus - члены

Microsoft.StylusInput - пространство имен

Stylus.TabletContextId

RealTimeStylus.GetTabletContextIdFromTablet