private async void AddPresetButton_Click(object sender, RoutedEventArgs e) { var dialog = new InputDialog("Preset Name"); dialog.ShowDialog(); if (dialog.Result) { string presetName = dialog.Text; ConfigurationManager.NewPreset(presetName); AnalyticsManager.NewPreset(); SetSources(); CompileProcessesListBox.SelectedIndex = 0; PresetConfigListBox.SelectedItem = presetName; } }
private async void ClonePresetMapButton_OnClick(object sender, RoutedEventArgs e) { if (!string.IsNullOrWhiteSpace(ConfigurationManager.CurrentPresetMap)) { var dialog = new InputDialog("Map Preset Name"); dialog.ShowDialog(); if (dialog.Result) { string presetMapName = dialog.Text; ConfigurationManager.ClonePresetMap(presetMapName); AnalyticsManager.NewPresetMap(); SetSources(true); CompileProcessesListBox.SelectedIndex = 0; PresetMapConfigListBox.SelectedItem = PresetMapConfigListBox.ItemsSource.Cast <PresetMapCheckbox>().FirstOrDefault(x => x.PresetMap == presetMapName); SetPreviousPresetMapSelectedItem(PresetMapConfigListBox.SelectedItem); } } }