private void workerDiscover_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error != null) { this.device = null; this.ShowError(e.Error); } else { this.device = e.Result as ArduinoNano; } this.UpdateSelectedValues(); this.OnPropertyChanged("Busy"); this.OnPropertyChanged("Connected"); this.OnPropertyChanged("ConnectionStatusText"); return; }
private void Disconnect() { this.device?.Dispose(); this.device = null; return; }