Ejemplo n.º 1
0
        internal void SetCodeCleanupAsConfigured()
        {
            var areCodeCleanupRulesConfigured = OptionService.GetOption <bool>(CodeCleanupOptions.AreCodeCleanupRulesConfigured, LanguageNames.CSharp);

            if (!areCodeCleanupRulesConfigured)
            {
                var oldOptions = OptionService.GetOptions();
                var newOptions = oldOptions.WithChangedOption(CodeCleanupOptions.AreCodeCleanupRulesConfigured, LanguageNames.CSharp, true);

                OptionService.SetOptions(newOptions);
                OptionLogger.Log(oldOptions, newOptions);
            }
        }
        internal override void LoadSettings()
        {
            base.LoadSettings();

            var preferences = OptionService.GetOption(SimplificationOptions.NamingPreferences, _languageName);
            if (preferences == null)
            {
                return;
            }

            _viewModel = new NamingStyleOptionPageViewModel(preferences);
            DataContext = _viewModel;
        }
        internal override void LoadSettings()
        {
            base.LoadSettings();

            var options = OptionService.GetOption(SimplificationOptions.NamingPreferences, _languageName);

            if (string.IsNullOrEmpty(options))
            {
                return;
            }

            var namingPreferencesXml = this.OptionService.GetOption(SimplificationOptions.NamingPreferences, _languageName);
            var preferencesInfo      = SerializableNamingStylePreferencesInfo.FromXElement(XElement.Parse(namingPreferencesXml));

            _viewModel       = new NamingStyleOptionPageViewModel(preferencesInfo);
            this.DataContext = _viewModel;
        }