UaClient/ServiceModel/Ua/Channels/CommunicationObject.cs
/// <summary>
/// Throws an <see cref="InvalidOperationException"/> if the communication object is not in the opening, open, or closing state.
/// </summary>
Throws an  if the communication object is not in the opening, open, or closing state.
Throws an if the communication object is not in the opening open or closing state .
protected void ThrowIfClosedOrNotOpening()
        {
            this.ThrowPending();
            switch (this.State)
            {
                case CommunicationState.Created:
                    throw new InvalidOperationException($"Channel not opened.");
                case CommunicationState.Opening:
                case CommunicationState.Opened:
                case CommunicationState.Closing:
                    return;
                case CommunicationState.Closed:
                case CommunicationState.Faulted:
                    throw new InvalidOperationException($"Channel closed or faulted.");
            }
        }
protected void ThrowIfClosedOrNotOpening ( ) { this . ThrowPending ( ) ; switch ( this . State ) { case CommunicationState . Created : throw new InvalidOperationException ( $" Channel not opened. " ) ; case CommunicationState . Opening : case CommunicationState . Opened : case CommunicationState . Closing : return ; case CommunicationState . Closed : case CommunicationState . Faulted : throw new InvalidOperationException ( $" Channel closed or faulted. " ) ; } }
Throws an  if the communication object is not in the opening, open, or closing state.
Throws an if the communication object is not in the opening open or closing state .