示例#1
0
        /// <summary>
        /// Function to commit any settings.
        /// </summary>
        public override void CommitSettings()
        {
            if (!string.IsNullOrWhiteSpace(textScratchLocation.Text))
            {
                Program.Settings.ScratchPath = textScratchLocation.Text.FormatDirectory(Path.DirectorySeparatorChar);
            }

            if (!string.IsNullOrWhiteSpace(textPlugInLocation.Text))
            {
                Program.Settings.PlugInDirectory = textPlugInLocation.Text.FormatDirectory(Path.DirectorySeparatorChar);
            }

            Program.Settings.DefaultImageEditor = comboImageEditor.Text;

            var speed = (float)numericAnimateSpeed.Value;

            if ((ContentManagement.Current == null) &&
                ((!Program.Settings.StartPageAnimationPulseRate.EqualsEpsilon(speed)) ||
                 (Program.Settings.AnimateStartPageLogo != checkAnimateLogo.Checked)))
            {
                Program.Settings.AnimateStartPageLogo        = checkAnimateLogo.Checked;
                Program.Settings.StartPageAnimationPulseRate = speed;
                ContentManagement.EditorSettingsUpdated();
            }

            Program.Settings.AutoLoadLastFile = checkAutoLoadFile.Checked;
        }
示例#2
0
        /// <summary>
        /// Function to commit any settings.
        /// </summary>
        public override void CommitSettings()
        {
            foreach (KeyValuePair <EditorPlugIn, PreferencePanel> panel in _settingPanels)
            {
                try
                {
                    panel.Value.CommitSettings();

                    // If we have content open that uses the plug-in that's been updated, notify its UI (if it has one).
                    if ((ContentManagement.Current != null) &&
                        (ContentManagement.Current.PlugIn == panel.Key))
                    {
                        ContentManagement.EditorSettingsUpdated();
                    }
                }
                catch (Exception ex)
                {
                    GorgonDialogs.ErrorBox(ParentForm, ex);
                }
            }
        }