示例#1
0
        private void Button_OK_Click(object sender, EventArgs e)
        {
            try
            {
                Ultility.MC_INITIAL_SIZE               = (int)this.NUD_MC_Initial.Value;
                Ultility.SIMULATION_BOUND              = (int)this.NUD_SimulationBound.Value;
                SettingUtils.CHECK_UPDATE_AT_START     = CheckBox_CheckUpdate.Checked;
                Ultility.ABSTRACT_CUT_NUMBER           = (int)this.NUD_CutNumber.Value;
                Ultility.ABSTRACT_CUT_NUMBER_BOUND     = (int)this.NUD_CutNumberBound.Value;
                SettingUtils.DEFAULT_MODELING_LANGUAGE = this.ComboBox_DefaultModelingLanguage.Text;
                Ultility.PERFORM_DETERMINIZATION       = CheckBox_PerformDeterminization.Checked;

                Common.Utility.Utilities.SEND_EMAIL_USE_SSL = CheckBox_EmailSSL.Checked;

                SettingUtils.LATEX_AUTO_SAVE = CheckBox_Latex_Autosave.AutoCheck;
                SettingUtils.AUTO_SAVE       = CheckBox_AutoSave.Checked;
                SettingUtils.LINK_CSP        = CheckBox_LinkCSP.Checked;

                if (CheckBox_LinkCSP.Checked)
                {
                    if (Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.csp") != null)
                    {
                        Registry.CurrentUser.DeleteSubKeyTree(@"Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.csp");
                    }
                    Registry.ClassesRoot.CreateSubKey(".csp").SetValue("", "CSP", Microsoft.Win32.RegistryValueKind.String);
                    Registry.ClassesRoot.CreateSubKey(@".csp\shell\open\command").SetValue("", Application.ExecutablePath + " \"%1\"", Microsoft.Win32.RegistryValueKind.String);
                }
                else
                {
                    if (Registry.ClassesRoot.OpenSubKey(".csp") != null)
                    {
                        Registry.ClassesRoot.DeleteSubKeyTree(".csp");
                    }
                }

                //BDD
                this.WriteBDDData();

                foreach (OptionPanelInterface tab in Tabs)
                {
                    tab.WriteData();
                }
            }
            catch (Exception ex)
            {
                //Common.Ultility.Ultility.LogException(ex, null);
            }

            SettingUtils.SaveSettingValue();
        }