예제 #1
0
        void ShowConfiguationWindow(ConfigurationWindowSettings configurationWindowSettings)
        {
            ConfigurationWindow configurationWindow = new ConfigurationWindow(configurationWindowSettings);

            configurationWindow.Closing += configurationWindow_Closing;
            configurationWindow.ShowDialog();
        }
예제 #2
0
        public ConfigurationViewModel(MainWindow mainView)
        {
            Log.Write("Open configuration window");
            MainV   = mainView;
            ConfigV = new ConfigurationWindow(this, MainV);

            ConfigV.ShowDialog();
        }
예제 #3
0
        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();
            }
        }
예제 #5
0
        /// <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();
        }
예제 #6
0
        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;
                    }
                }
            }));
        }
예제 #7
0
    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();
    }
예제 #8
0
 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;
             }
         }
     }));
 }
예제 #9
0
        private void OnConfigure()
        {
            var window = new ConfigurationWindow();

            window.ShowDialog();
        }
예제 #10
0
        public void ShowSettings()
        {
            ConfigurationWindow view = new ConfigurationWindow();

            view.ShowDialog();
        }
예제 #11
0
        private void PreferencesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ConfigurationWindow configurationWindow = new ConfigurationWindow();

            configurationWindow.ShowDialog();
        }
예제 #12
0
        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);
            }
        }
예제 #13
0
        public void OpenConfigWindow(object parameter)
        {
            ConfigurationWindow ob = new ConfigurationWindow();

            ob.ShowDialog();
        }
예제 #14
0
        private void OpenConfigWindow(object o)
        {
            ConfigurationWindow configWindow = new ConfigurationWindow();

            configWindow.ShowDialog();
        }
예제 #15
0
 private void OpenConfigWindow(object o)
 {
     ConfigurationWindow configWindow = new ConfigurationWindow();
     configWindow.ShowDialog();
 }
예제 #16
0
        public void OpenConfigurationWindow()
        {
            ConfigurationWindow window = new ConfigurationWindow(_configuration);

            window.ShowDialog();
        }
예제 #17
0
        private void OpenConfiguration(object sender, RoutedEventArgs e)
        {
            ConfigurationWindow configWindow = new ConfigurationWindow(_configManager);

            configWindow.ShowDialog();
        }
예제 #18
0
        public void OtworzKonfiguracje()
        {
            _configurationWindow = new ConfigurationWindow();

            _configurationWindow.ShowDialog();
        }