この RealTimeStylus オブジェクトによって使用されているすべてのリソースを解放します。
名前空間 : 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()
実装
解説
Dispose メソッドを呼び出すと、オブジェクトによって使用されているリソースを他の目的のために再割り当てできます。
RealTimeStylus オブジェクトは、Dispose メソッドのスレッド セーフを保証しません。他のスレッドが RealTimeStylus オブジェクトを使用している可能性がある場合は、Dispose メソッドを呼び出さないでください。
![]() |
---|
Microsoft Windows XP Tablet PC Edition Software Development Kit (SDK) を使用する場合、イベント ハンドラがアタッチされているオブジェクトまたはコントロールがスコープの外に出る前に、それらのオブジェクトまたはコントロールで dispose メソッドを明示的に呼び出す必要があります。 |
Dispose が定義されている、Tablet PC SDK 内の任意のクラスについて、そのクラスのインスタンスが不要になった場合は、手動で破棄してください。こうして不要になったオブジェクトを破棄すると、アプリケーションのパフォーマンスが向上します。
![]() |
---|
RealTimeStylus オブジェクトは、その Dispose メソッドが、IStylusSyncPlugin または IStylusAsyncPlugin インターフェイスのメソッド実装のプラグインのいずれかによって呼び出されると、例外をスローします。 |
例
この Microsoft Visual C# .NET の例は、フォームの Closed イベント ハンドラのスニペットです。これにより、RealTimeStylus、GestureRecognizer、および DynamicRenderer オブジェクトを無効にし、RealTimeStylus オブジェクトのキューを空にして、オブジェクトの Dispose メソッドを呼び出します。
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 SP2, Windows Server 2003
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0