Esempio n. 1
0
        public void Reset(CodeAnalysisConfig configuration1, CodeAnalysisConfig configuration2)
        {
            Disabled.Clear();

            SetValues(configuration1);
            SetValues(configuration2);
        }
        protected override void SetValues(CodeAnalysisConfig configuration)
        {
            if (configuration == null)
            {
                return;
            }

            foreach (KeyValuePair <string, bool> kvp in configuration.CodeFixes)
            {
                string id        = kvp.Key;
                bool   isEnabled = kvp.Value;

                if (CodeFixIdentifier.TryParse(id, out CodeFixIdentifier codeFixIdentifier))
                {
                    Set(codeFixIdentifier, isEnabled);
                }
                else if (id.StartsWith(CodeFixIdentifier.CodeFixIdPrefix, StringComparison.Ordinal))
                {
                    foreach (string compilerDiagnosticId in CodeFixMap.GetCompilerDiagnosticIds(id))
                    {
                        Set(new CodeFixIdentifier(compilerDiagnosticId, id), isEnabled);
                    }
                }
                else if (id.StartsWith("CS", StringComparison.Ordinal))
                {
                    foreach (string codeFixId in CodeFixMap.GetCodeFixIds(id))
                    {
                        Set(new CodeFixIdentifier(id, codeFixId), isEnabled);
                    }
                }
                else
                {
                    Debug.Fail(id);
                }
            }
        }
Esempio n. 3
0
 protected abstract void SetValues(CodeAnalysisConfig configuration);
Esempio n. 4
0
 internal void UpdateConfig()
 {
     CodeAnalysisConfig.UpdateVisualStudioConfig(f => f.WithCodeFixes(GetItems()));
 }
 internal void UpdateConfig()
 {
     CodeAnalysisConfig.UpdateVisualStudioConfig(f => f.WithRefactorings(GetItems()));
 }