private void SettingsCommand(object sender, ExecutedRoutedEventArgs e) { var settings = FlasherConfig.Read(); var oldDevice = settings.Device.Name; var dlg = new SettingsWindow { DataContext = settings, Owner = this }; if (dlg.ShowDialog() ?? false) { settings.Save(); if (settings.Device.Name != oldDevice) { Model.ClearAll(); } Model.ReloadConfig(); } }
private StatisticsChannel OpenChannel() { lock (_channelSync) { try { if (_channel == null) { _channel = new StatisticsChannel(FlasherConfig.Read().GetProgrammerConfig().CreateChannel()); } if (!_channel.IsOpen) { _channel.Open(); } return(_channel); } catch (Exception) { CloseChannel(); return(null); } } }