Exemple #1
0
        private void OnGeneralSettingsChanged(object sender, RoutedEventArgs e)
        {
            if (!this.IsLoaded)
            {
                return;
            }

            if (_mainWindow == null || _optionSettings == null || _wpfSettings == null)
            {
                return;
            }
            if (_isInitialising)
            {
                return;
            }

            _isInitialising = true;

            _isGeneralModified = true;

            if (sender == chkHidePathsRoot)
            {
                _optionSettings.HidePathsRoot = chkHidePathsRoot.IsChecked.Value;

                if (chkHidePathsRoot.IsChecked != null && chkHidePathsRoot.IsChecked.Value)
                {
                    txtSvgPath.IsReadOnly = true;
                }
                else
                {
                    txtSvgPath.IsReadOnly = false;
                }

                txtSvgPath.Text        = _optionSettings.GetPath(_optionSettings.CurrentSvgPath);
                txtSvgPathDefault.Text = _optionSettings.GetPath(_optionSettings.DefaultSvgPath);
            }

            _optionSettings.RecursiveSearch = chkRecursiveSearch.IsChecked.Value;
            _optionSettings.ShowInputFile   = chkShowInputFile.IsChecked.Value;
            _optionSettings.ShowOutputFile  = chkShowOutputFile.IsChecked.Value;

            _isInitialising = false;
        }
Exemple #2
0
        private void OnPageLoaded(object sender, RoutedEventArgs e)
        {
            if (_mainWindow == null || _mainWindow.OptionSettings == null)
            {
                return;
            }
            _optionSettings = _mainWindow.OptionSettings;

            var wpfSettings = _optionSettings.ConversionSettings;

            if (wpfSettings != null)
            {
                _wpfSettings = wpfSettings.Clone();
            }
            if (_wpfSettings == null)
            {
                return;
            }

            _isInitialising = true;

            txtSvgPath.Text        = _optionSettings.GetPath(_optionSettings.CurrentSvgPath);
            txtSvgPathDefault.Text = _optionSettings.GetPath(_optionSettings.DefaultSvgPath);

            txtSvgPath.IsReadOnly = _optionSettings.HidePathsRoot;

            chkHidePathsRoot.IsChecked   = _optionSettings.HidePathsRoot;
            chkRecursiveSearch.IsChecked = _optionSettings.RecursiveSearch;
            chkShowInputFile.IsChecked   = _optionSettings.ShowInputFile;
            chkShowOutputFile.IsChecked  = _optionSettings.ShowOutputFile;

            chkTextAsGeometry.IsChecked = _wpfSettings.TextAsGeometry;
            chkIncludeRuntime.IsChecked = _wpfSettings.IncludeRuntime;

            chkIgnoreRootViewbox.IsChecked     = _wpfSettings.IgnoreRootViewbox;
            chkEnsureViewboxSize.IsChecked     = _wpfSettings.EnsureViewboxSize;
            chkEnsureViewboxPosition.IsChecked = _wpfSettings.EnsureViewboxPosition;

            _isConversionModified = false;

            _isInitialising = false;
        }