PeerNameRegistration.Dispose 方法

定義

釋放 PeerNameRegistration 物件所使用的資源。

多載

Dispose()

釋放由 PeerNameRegistration 物件使用的所有資源。

Dispose(Boolean)

釋放 Unmanaged 資源,並選擇性釋放 PeerNameRegistration 物件所使用的 Managed 資源。

備註

當對等離開 Cloud時,雲端不再需要 PeerNameRegistration 與對等相關聯的物件。 註冊物件是否停止或處置取決於雲端是否會重複使用對象來註冊此對等或其他對等。 如果有任何其他端點 (在對等主機預期通訊的註冊物件內) ,則必須先在雲端中註冊這些端點,才能停止或處置此物件。

如果雲端預期要註冊更多對等, Stop 建議使用 方法;當雲端不再需要記憶體時,應該透過 Dispose 方法傳回操作系統。

Dispose()

釋放由 PeerNameRegistration 物件使用的所有資源。

public:
 virtual void Dispose();
public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()

實作

給呼叫者的注意事項

在終結 PeerNameRegistration 物件之前,請一律呼叫 Dispose 方法。

適用於

Dispose(Boolean)

釋放 Unmanaged 資源,並選擇性釋放 PeerNameRegistration 物件所使用的 Managed 資源。

protected:
 virtual void Dispose(bool disposing);
protected virtual void Dispose (bool disposing);
abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit
Protected Overridable Sub Dispose (disposing As Boolean)

參數

disposing
Boolean

true 表示釋放 Managed 和 Unmanaged 資源,false 則表示只釋放 Unmanaged 資源。

給呼叫者的注意事項

一律先呼叫 Dispose 方法,再釋放對象的最後一 PeerNameRegistration 個參考。

適用於