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 状态是唯一一个既可变又不被释放的状态。

适用于