private void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { this.avr?.Close(); } this.avr = null; this.disposed = true; } }
public override void Connect() { this.disposed = false; this.avr = new AvrClient() { Host = this.Host, Port = this.Port, }; this.avr.Disconnected += ClientDisconnected; this.avr.PropertyChanged += ClientPropertyChanged; try { this.avr.Connect(); OnConnected(); } catch { this.ControllerStatus = ControllerStatus.Error; OnError(string.Format(CultureInfo.InvariantCulture, Properties.Resources.FMT_NETWORK_TIMEOUT, "processor")); } }