private void updateEddiConfiguration() { EDDIConfiguration eddiConfiguration = new EDDIConfiguration(); eddiConfiguration.HomeSystem = String.IsNullOrWhiteSpace(eddiHomeSystemText.Text) ? null : eddiHomeSystemText.Text.Trim(); eddiConfiguration.HomeStation = String.IsNullOrWhiteSpace(eddiHomeStationText.Text) ? null : eddiHomeStationText.Text.Trim(); eddiConfiguration.Insurance = eddiInsuranceDecimal.Value == null ? 5 : (decimal)eddiInsuranceDecimal.Value; eddiConfiguration.Debug = debug; eddiConfiguration.ToFile(); }
private void onExportTargetChanged(object sender, SelectionChangedEventArgs e) { string exportTarget = (string)((ComboBox)e.Source).SelectedValue; Logging.Debug("Export target: " + exportTarget); EDDIConfiguration eddiConfiguration = EDDIConfiguration.FromFile(); eddiConfiguration.exporttarget = string.IsNullOrWhiteSpace(exportTarget) ? null : exportTarget.Trim(); eddiConfiguration.ToFile(); }
public ConfigurationWindow() { InitializeComponent(); shipData.ItemsSource = shipMonitor().shipyard; EDDIConfiguration eddiConfiguration = EDDIConfiguration.FromFile(); string exportTarget = eddiConfiguration.exporttarget; // handle migration if (exportTarget == "EDShipyard") { exportTarget = "EDSY"; eddiConfiguration.exporttarget = exportTarget; eddiConfiguration.ToFile(); } Logging.Debug("Export target from configuration: " + exportTarget); exportComboBox.Text = exportTarget ?? "Coriolis"; }