RealTimeStylus.Dispose 메서드
업데이트: 2007년 11월
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 SDK(소프트웨어 개발 키트)부터는 이벤트 처리기가 연결된 개체나 컨트롤이 범위를 벗어나기 전에 모든 해당 개체나 컨트롤에 대해 dispose 메서드를 명시적으로 호출해야 합니다.
Dispose가 정의되어 있는 Tablet PC SDK의 모든 클래스가 더 이상 필요 없는 경우에는 해당 클래스의 각 인스턴스를 수동으로 삭제합니다. 이러한 개체를 삭제하면 응용 프로그램의 성능이 향상됩니다.
참고
플러그 인 중 하나가 IStylusSyncPlugin 또는 IStylusAsyncPlugin 인터페이스 메서드 구현에서 Dispose 메서드를 호출하면 RealTimeStylus 개체에서 예외를 throw합니다.
예제
이 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에서 지원