void ShowConfiguationWindow(ConfigurationWindowSettings configurationWindowSettings) { ConfigurationWindow configurationWindow = new ConfigurationWindow(configurationWindowSettings); configurationWindow.Closing += configurationWindow_Closing; configurationWindow.ShowDialog(); }
public ConfigurationViewModel(MainWindow mainView) { Log.Write("Open configuration window"); MainV = mainView; ConfigV = new ConfigurationWindow(this, MainV); ConfigV.ShowDialog(); }
private void Configure_Click(object sender, RoutedEventArgs e) { ChangeButtonsAccess(); var configurationWindow = new ConfigurationWindow(GameSettings); configurationWindow.ShowDialog(); GameSettings = configurationWindow.GameSetting; ChangeButtonsAccess(); }
private void ShowSettings(object obj) { var dlg = new ConfigurationWindow(_root.Config); if (dlg.ShowDialog().Value) { _root.Config = (Configuration)dlg.DataContext; _root.Save(); } }
/// <summary> /// Создает окно для редактирования выбранного источника /// </summary> public void CreateUpdateConfigurationView(Source source) { var view = new ConfigurationWindow(); var viewModel = new ConfigurationWindowViewModel(source); if (viewModel.CloseAction == null) { viewModel.CloseAction = new Action(view.Close); } view.DataContext = viewModel; view.ShowDialog(); }
public static SettingsEditor <TProfileSettings, TInfo> Create() { return(new SettingsEditor <TProfileSettings, TInfo>( delegate(MainForm mainForm, ref TProfileSettings settings, ref string profileName, TInfo info) { TPanel t = (TPanel)System.Activator.CreateInstance(typeof(TPanel), mainForm, info); using (ConfigurationWindow <TSettings, TProfileSettings> scd = new ConfigurationWindow <TSettings, TProfileSettings>(mainForm.Profiles, t, t, profileName)) { scd.Settings = (TSettings)settings; // Set the settings in case there is no profile configured if (scd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { /* Get the selected profile and see if its settings match the current * configuration of the window. If they do, continue as normal. If not, * ask the user whether he/she wants to overwrite the profile's settings * with the currently configured ones. If the user answers no, then the * settings are returned as an unnamed profile; this is a special case, * and generates a temporary group of settings. */ Profile prof = scd.CurrentProfile; if (prof != null && !scd.Settings.Equals(prof.BaseSettings)) { if (MessageBox.Show("Profile has been changed. Update the selected profile?", "Profile update", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { prof.BaseSettings = scd.Settings; } else { prof = null; } } if (prof == null) { profileName = ""; } else { profileName = prof.Name; } settings = scd.Settings; return true; } else { return false; } } })); }
private void ButtonEditConfiguration_Click(object sender, RoutedEventArgs e) { var oldImportConfigurations = new ObservableCollection <ImportConfiguration>(); foreach (ImportConfiguration i in ViewModel.ImportConfigurations) { oldImportConfigurations.Add(new ImportConfiguration() { DestinationFormat = i.DestinationFormat, Files = i.Files }); } var oldLibraryRootDirectories = new ObservableCollection <LibraryRoot>(); foreach (LibraryRoot l in ViewModel.LibraryRootDirectories) { oldLibraryRootDirectories.Add(new LibraryRoot(l.Path)); } ConfigurationWindow configurationWindow = new ConfigurationWindow() { Owner = this, DataContext = ViewModel }; configurationWindow.ShowDialog(); if (configurationWindow.DialogResult == true) { SaveSettings(); } else { ViewModel.ImportConfigurations = new ObservableCollection <ImportConfiguration>(oldImportConfigurations); ViewModel.LibraryRootDirectories = new ObservableCollection <LibraryRoot>(oldLibraryRootDirectories); } ViewModel.Refresh(); }
public static SettingsEditor <TProfileSettings, TInfo> Create() { return(new SettingsEditor <TProfileSettings, TInfo>( delegate(MainForm mainForm, ref TProfileSettings settings, ref string profile, TInfo info) { TPanel t = (TPanel)System.Activator.CreateInstance(typeof(TPanel), mainForm, info); using (ConfigurationWindow <TSettings, TProfileSettings> scd = new ConfigurationWindow <TSettings, TProfileSettings>(mainForm.Profiles, t, t, profile)) { scd.Settings = (TSettings)settings; // Set the settings in case there is no profile configured if (scd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { settings = scd.Settings; // Again, in case no profile is configured profile = scd.CurrentProfile; return true; } else { return false; } } })); }
private void OnConfigure() { var window = new ConfigurationWindow(); window.ShowDialog(); }
public void ShowSettings() { ConfigurationWindow view = new ConfigurationWindow(); view.ShowDialog(); }
private void PreferencesToolStripMenuItem_Click(object sender, EventArgs e) { ConfigurationWindow configurationWindow = new ConfigurationWindow(); configurationWindow.ShowDialog(); }
public void ShowConfiguration() { #region LeftHand Variables bool? autoHideDock = AutoHideDock; double? hideAnimationDuration = this.HideAnimationDuration; double? hideTimerMilliseconds = this.HideTimerMilliseconds; double? showAnimationDuration = this.ShowAnimationDuration; double? showTimerMilliseconds = this.ShowTimerMilliseconds; int? screen = this.Screen; Theme changeToTheme = null; IIconFlow changeToIconFlow = null; #endregion ConfigurationWindow configWindow = new ConfigurationWindow(); // save the current icon flow and theme before the window is shown bool?result = configWindow.ShowDialog(); if (result.HasValue && result.Value) { #region Right Hand Checks // check and see if the current Icon Flow matches the type name // of the icon flow set in the settings var selectedIconFlow = (configWindow.IconFlowComboBox.SelectedItem as IIconFlow); if (selectedIconFlow != IconFlow) { // if not, get a reference to the new icon flow object changeToIconFlow = selectedIconFlow; } var selectedTheme = (configWindow.ThemeComboBox.SelectedItem as Theme); // check and see if the current theme matches the theme filename // of the theme set in the settings if (selectedTheme != Theme) { // if not, get a reference to the new theme object changeToTheme = selectedTheme; } if (autoHideDock.Value == AutoHideDock) { autoHideDock = null; } else { autoHideDock = AutoHideDock; } if (hideAnimationDuration.Value == HideAnimationDuration) { hideAnimationDuration = null; } else { hideAnimationDuration = HideAnimationDuration; } if (hideTimerMilliseconds.Value == HideTimerMilliseconds) { hideTimerMilliseconds = null; } else { hideTimerMilliseconds = HideAnimationDuration; } if (showAnimationDuration == ShowAnimationDuration) { showAnimationDuration = null; } else { showAnimationDuration = ShowAnimationDuration; } if (showTimerMilliseconds == ShowTimerMilliseconds) { showTimerMilliseconds = null; } else { showTimerMilliseconds = ShowTimerMilliseconds; } if (screen == this.Screen) { screen = null; } else { screen = this.Screen; } #endregion OnSettingsChanged(changeToTheme, changeToIconFlow, autoHideDock, hideAnimationDuration, hideTimerMilliseconds, showAnimationDuration, showTimerMilliseconds, screen); } }
public void OpenConfigWindow(object parameter) { ConfigurationWindow ob = new ConfigurationWindow(); ob.ShowDialog(); }
private void OpenConfigWindow(object o) { ConfigurationWindow configWindow = new ConfigurationWindow(); configWindow.ShowDialog(); }
private void OpenConfigWindow(object o) { ConfigurationWindow configWindow = new ConfigurationWindow(); configWindow.ShowDialog(); }
public void OpenConfigurationWindow() { ConfigurationWindow window = new ConfigurationWindow(_configuration); window.ShowDialog(); }
private void OpenConfiguration(object sender, RoutedEventArgs e) { ConfigurationWindow configWindow = new ConfigurationWindow(_configManager); configWindow.ShowDialog(); }
public void OtworzKonfiguracje() { _configurationWindow = new ConfigurationWindow(); _configurationWindow.ShowDialog(); }