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


RealTimeStylus.Dispose - метод

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

Releases all resources used by the RealTimeStylus object.

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

Синтаксис

'Декларация
Public Sub Dispose
'Применение
Dim instance As RealTimeStylus

instance.Dispose()
public void Dispose()
public:
virtual void Dispose() sealed
public final void Dispose()
public final function Dispose()

Реализации

IDisposable.Dispose()

Заметки

Calling the Dispose method allows the resources used by the object to be reallocated for other purposes.

The RealTimeStylus object does not guarantee thread safety for the Dispose method. Avoid calling the Dispose method while other threads may be using the RealTimeStylus object.

Предупреждение

Starting with the Microsoft Windows XP Tablet PC Edition Software Development Kit (SDK), you must explicitly call the dispose method on any object or control in to which an event handler has been attached before the object or control goes out of scope.

For any class in the Tablet PC SDK on which Dispose is defined, manually dispose of each instance of that class when it is no longer needed. Disposing of these objects improves your application's performance.

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

The RealTimeStylus object throws an exception if its Dispose method is called by any of its plug-ins from an IStylusSyncPlugin or IStylusAsyncPlugin interface method implementation.

Примеры

This Microsoft Visual C# .NET example is a snippet from a form's Closed event handler, which disables the RealTimeStylus, GestureRecognizer, and DynamicRenderer objects, empties the RealTimeStylus objects' queues, and calls the Dispose method of the objects.

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;

// ...

// The form's Closed event handler.
private void theForm_Closed(object sender, System.EventArgs e)
{
    // Disable appropriate plug-ins.
    this.theGestureRecognizer.Enabled = false;
    this.theDynamicRenderer.Enabled = false;
    this.theFilterPlugin.Enabled = false;

    // Empty the RealTimeStylus queues
    this.thePrimaryRealTimeStylus.ClearStylusQueues();
    this.theSecondaryRealTimeStylus.ClearStylusQueues();

    // Disable the RealTimeStylus.
    this.thePrimaryRealTimeStylus.Enabled = false;

    // Dispose of the the RealTimeStylus objects and appropriate plug-ins.
    this.thePrimaryRealTimeStylus.Dispose();
    this.thePrimaryRealTimeStylus = null;
    this.theSecondaryRealTimeStylus.Dispose();
    this.theSecondaryRealTimeStylus = null;
    this.theDynamicRenderer.Dispose();
    this.theDynamicRenderer = null;
    this.theGestureRecognizer.Dispose();
    this.theGestureRecognizer = null;
}

Платформы

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

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

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

.NET Framework

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

См. также

Ссылки

RealTimeStylus Класс

RealTimeStylus - члены

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