internal bool OnEnd(End end)
{
lock (this.ThisLock)
{
if (this.state == State.EndSent)
{
this.state = State.End;
}
else if (this.state == State.Opened)
{
this.SendEnd();
this.state = State.End;
}
else
{
throw new AmqpException(ErrorCode.IllegalState,
Fx.Format(SRAmqp.AmqpIllegalOperationState, "OnEnd", this.state));
}
this.OnClose(end.Error);
this.NotifyClosed(end.Error);
return true;
}
}