Export (0) Print
Expand All

CommunicationObject.ThrowIfDisposedOrImmutable Method

Throws an exception if the communication object the State property is not set to the Created state.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

protected internal void ThrowIfDisposedOrImmutable()

ExceptionCondition
InvalidOperationException

The communication object is in a Opening or Opened state.

ObjectDisposedException

The communication object is in a Closing or Closed state.

CommunicationObjectFaultedException

The communication object is in a Faulted state.

Since an object is immutable after Open is called on it, the only state that is both mutable and not disposed is the Created state.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft