internal bool OnDetach(Detach detach)
{
lock (this.ThisLock)
{
if (this.state == LinkState.DetachSent)
{
this.state = LinkState.End;
}
else if (this.state == LinkState.Attached)
{
this.SendDetach(null);
this.state = LinkState.End;
}
else
{
throw new AmqpException(ErrorCode.IllegalState,
Fx.Format(SRAmqp.AmqpIllegalOperationState, "OnDetach", this.state));
}
this.OnClose(detach.Error);
this.NotifyClosed(detach.Error);
return true;
}
}