Exemplo n.º 1
0
        private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;

            FormatSettings settings = new FormatSettings ();
            settings.style = StyleCombo.SelectedItem as StyleInfo;
            settings.applyOnSave = FormatOnSaveCheckbox.IsChecked;
            db.setSettings (itemToEnum[settingsScopeCombo.SelectedItem as ComboBoxItem], settings);
        }
Exemplo n.º 2
0
        public void setSettings(FormatterSettingsScope scope, FormatSettings scopeSettings)
        {
            settings[scope] = scopeSettings;

            switch (scope)
            {
                case FormatterSettingsScope.global:
                    using (settingsHelper.folderScope(SettingsFolderSettingsPerSolution))
                    {
                        if (this.activeSolutionName != null)
                            settingsHelper.DeleteCollection(activeSolutionName);
                    }
                    scopeSettings.save (settingsHelper);
                    break;
                case FormatterSettingsScope.forSolution:
                    if (String.IsNullOrEmpty (activeSolutionName))
                       break;

                    using (settingsHelper.folderScope(SettingsFolderSettingsPerSolution))
                    {
                        using (settingsHelper.folderScope(activeSolutionName))
                        {
                            scopeSettings.save(settingsHelper);
                        }
                    }
                    break;
            }
        }