Esempio n. 1
0
        public void InitializeSettings()
        {
            GeneralOptionsPage            generalOptionsPage            = GeneralOptionsPage;
            RefactoringsOptionsPage       refactoringsOptionsPage       = RefactoringsOptionsPage;
            CodeFixesOptionsPage          codeFixesOptionsPage          = CodeFixesOptionsPage;
            GlobalSuppressionsOptionsPage globalSuppressionsOptionsPage = GlobalSuppressionsOptionsPage;

            Version currentVersion = typeof(GeneralOptionsPage).Assembly.GetName().Version;

            if (!Version.TryParse(generalOptionsPage.ApplicationVersion, out Version version) ||
                version < currentVersion)
            {
                generalOptionsPage.ApplicationVersion = currentVersion.ToString();
                generalOptionsPage.SaveSettingsToStorage();
            }

            codeFixesOptionsPage.CheckNewItemsDisabledByDefault();
            refactoringsOptionsPage.CheckNewItemsDisabledByDefault();
            globalSuppressionsOptionsPage.CheckNewItemsDisabledByDefault();

            SettingsManager.Instance.UpdateVisualStudioSettings(generalOptionsPage);
            SettingsManager.Instance.UpdateVisualStudioSettings(refactoringsOptionsPage);
            SettingsManager.Instance.UpdateVisualStudioSettings(codeFixesOptionsPage);
            SettingsManager.Instance.UpdateVisualStudioSettings(globalSuppressionsOptionsPage);
        }
Esempio n. 2
0
        public void InitializeSettings()
        {
            GeneralOptionsPage      generalOptionsPage      = GeneralOptionsPage;
            RefactoringsOptionsPage refactoringsOptionsPage = RefactoringsOptionsPage;
            CodeFixesOptionsPage    codeFixesOptionsPage    = CodeFixesOptionsPage;

            Version currentVersion = typeof(GeneralOptionsPage).Assembly.GetName().Version;

            if (!Version.TryParse(generalOptionsPage.ApplicationVersion, out Version version) ||
                version < currentVersion)
            {
                generalOptionsPage.ApplicationVersion = currentVersion.ToString();
                generalOptionsPage.SaveSettingsToStorage();
            }

            refactoringsOptionsPage.CheckNewItemsDisabledByDefault(CodeAnalysisConfiguration.Current.GetDisabledRefactorings());
            codeFixesOptionsPage.CheckNewItemsDisabledByDefault(CodeAnalysisConfiguration.Current.GetDisabledCodeFixes());

            generalOptionsPage.ApplyTo(Settings.Instance);
            refactoringsOptionsPage.ApplyTo(Settings.Instance);
            codeFixesOptionsPage.ApplyTo(Settings.Instance);
        }