private void ListBox_BMS_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (!e.Source.Equals(ListBox_BMS)) { return; } if (appReg == null) { return; } Properties.Settings.Default.BMS_Version = this.ListBox_BMS.SelectedItem.ToString(); appReg.Init(this, this.ListBox_BMS.SelectedItem.ToString()); BMSChanged(); ReloadDevices(); } catch (Exception ex) { Diagnostics.WriteLogFile(ex); Close(); } }