共用方式為


CommunicationObject.ThrowIfDisposedOrImmutable 方法

定義

如果通訊物件的 State 屬性並未設定為 Created 狀態,就會擲回例外狀況。

protected public:
 void ThrowIfDisposedOrImmutable();
protected:
 void ThrowIfDisposedOrImmutable();
protected internal void ThrowIfDisposedOrImmutable ();
protected void ThrowIfDisposedOrImmutable ();
member this.ThrowIfDisposedOrImmutable : unit -> unit
Protected Friend Sub ThrowIfDisposedOrImmutable ()
Protected Sub ThrowIfDisposedOrImmutable ()

例外狀況

通訊物件處於 OpeningOpened 狀態中。

通訊物件處於 ClosingClosed 狀態中。

通訊物件處於 Faulted 狀態中。

備註

因為針對物件呼叫 Open 後,物件就無法變更,所以同時為可變動與未處置的唯一狀態是 Created 狀態。

適用於