private void CheckConnected() { if (!this.Connected) { if (this.autoConnect) this.Connect(); else if (this.OnDisconnected != null) this.OnDisconnected.Invoke(this); throw new NotConnectedException(); } }