Inheritance: System.Windows.Window
コード例 #1
0
ファイル: MainView.xaml.cs プロジェクト: zhiyongpeng/xFunc
        private void SettingsCommand_Execute(object o, ExecutedRoutedEventArgs args)
        {
            var settingsView = new SettingsView
            {
                Owner = this
            };

            if (settingsView.ShowDialog() == true)
            {
                Settings.Default.Lang = settingsView.ProgramLanguage;
                Settings.Default.RememberSizeAndPosition = settingsView.RememberStateAndPosition;
                Settings.Default.RememberRightToolBar    = settingsView.RememberRightToolBar;
                Settings.Default.RememberBaseAndAngle    = settingsView.RememberNumberAndAngle;
                if (!settingsView.RememberNumberAndAngle)
                {
                    Settings.Default.AngleMeasurement = settingsView.Angle;
                    Settings.Default.NumberBase       = settingsView.Base;

                    mathPresenter.AngleMeasurement = settingsView.Angle;
                    mathPresenter.Base             = settingsView.Base;
                }
                Settings.Default.MaxCountOfExpressions = settingsView.MaxCountOfExps;
                Settings.Default.DefaultChartColor     = settingsView.ChartColor;
                Settings.Default.SaveUserFunction      = settingsView.SaveUserFunctions;
                Settings.Default.SaveDump = settingsView.SaveDump;

                Settings.Default.Save();
            }
            else
            {
                Settings.Default.Reload();
            }
        }
コード例 #2
0
ファイル: MainView.xaml.cs プロジェクト: smwentum/xFunc
        private void SettingsCommand_Execute(object o, ExecutedRoutedEventArgs args)
        {
            var settingsView = new SettingsView()
            {
                Owner = this
            };
            if (settingsView.ShowDialog() == true)
            {
                Settings.Default.Lang = settingsView.ProgramLanguage;
                Settings.Default.RememberSizeAndPosition = settingsView.RememberStateAndPosition;
                Settings.Default.RememberRightToolBar = settingsView.RememberRightToolBar;
                Settings.Default.RememberBaseAndAngle = settingsView.RememberNumberAndAngle;
                if (!settingsView.RememberNumberAndAngle)
                {
                    Settings.Default.AngleMeasurement = settingsView.Angle;
                    Settings.Default.NumberBase = settingsView.Base;

                    mathPresenter.AngleMeasurement = settingsView.Angle;
                    mathPresenter.Base = settingsView.Base;
                }
                Settings.Default.MaxCountOfExpressions = settingsView.MaxCountOfExps;
                Settings.Default.SaveUserFunction = settingsView.SaveUserFunctions;
                Settings.Default.CheckUpdates = settingsView.CheckUpdates;

                Settings.Default.Save();
            }
            else
            {
                Settings.Default.Reload();
            }
        }