WaitHandle.SafeWaitHandle 屬性

定義

取得或設定原生 (Native) 的作業系統控制代碼。Gets or sets the native operating system handle.

public:
 property Microsoft::Win32::SafeHandles::SafeWaitHandle ^ SafeWaitHandle { Microsoft::Win32::SafeHandles::SafeWaitHandle ^ get(); void set(Microsoft::Win32::SafeHandles::SafeWaitHandle ^ value); };
public Microsoft.Win32.SafeHandles.SafeWaitHandle SafeWaitHandle { get; set; }
[get: System.Security.SecurityCritical]
[set: System.Security.SecurityCritical]
public Microsoft.Win32.SafeHandles.SafeWaitHandle SafeWaitHandle { get; set; }
member this.SafeWaitHandle : Microsoft.Win32.SafeHandles.SafeWaitHandle with get, set
[<get: System.Security.SecurityCritical>]
[<set: System.Security.SecurityCritical>]
member this.SafeWaitHandle : Microsoft.Win32.SafeHandles.SafeWaitHandle with get, set
Public Property SafeWaitHandle As SafeWaitHandle

屬性值

SafeWaitHandle

SafeWaitHandle,代表原生作業系統控制代碼。A SafeWaitHandle representing the native operating system handle.

屬性

備註

當您指派新值給屬性時 SafeWaitHandle ,會在收集先前的物件時關閉先前的控制碼 SafeWaitHandleWhen you assign a new value to the SafeWaitHandle property, the previous handle will be closed when the previous SafeWaitHandle object is collected. 請勿手動關閉控制碼,因為這 ObjectDisposedException SafeWaitHandle 會在嘗試關閉控制碼時產生。Do not manually close the handle, because this results in an ObjectDisposedException when the SafeWaitHandle attempts to close the handle.

WaitHandle 實作為 Dispose 模式。WaitHandle implements the Dispose pattern. 請參閱 執行 Dispose 方法See Implementing a Dispose method. 當您衍生自時 WaitHandle ,請使用 SafeWaitHandle 屬性來儲存您的原生控制碼作業系統控制碼。When you derive from WaitHandle, use the SafeWaitHandle property to store your native handle operating system handle. 除非您使用其他未受管理的資源,否則不需要覆寫受保護的 Dispose 方法。You do not need to override the protected Dispose method unless you use additional unmanaged resources.

適用於