protected override void Fill(ICollection <BaseModel> items)
        {
            items.Clear();

            foreach ((CodeFixDescriptor codeFixDescriptor, string compilerDiagnosticId) in CodeFixMap.CodeFixDescriptorsById
                     .SelectMany(kvp => kvp.Value.FixableDiagnosticIds.Select(compilerDiagnosticId => (codeFixDescriptor: kvp.Value, compilerDiagnosticId: compilerDiagnosticId)))
                     .OrderBy(f => f.compilerDiagnosticId)
                     .ThenBy(f => f.codeFixDescriptor.Id))
            {
                var model = new CodeFixModel(compilerDiagnosticId, CodeFixMap.CompilerDiagnosticsById[compilerDiagnosticId].Title.ToString(), codeFixDescriptor.Id, codeFixDescriptor.Title);

                model.Enabled = IsEnabled(model.Id);

                items.Add(model);
            }
        }
Exemple #2
0
        protected override void Fill(ICollection <BaseModel> items)
        {
            items.Clear();

            foreach (CompilerDiagnosticFix compilerDiagnosticFix in CodeFixMap.GetCompilerDiagnosticFixes()
                     .OrderBy(f => f.CompilerDiagnosticId)
                     .ThenBy(f => f.CodeFixId))
            {
                var model = new CodeFixModel(
                    compilerDiagnosticFix.CompilerDiagnosticId,
                    compilerDiagnosticFix.CompilerDiagnosticTitle,
                    compilerDiagnosticFix.CodeFixId,
                    compilerDiagnosticFix.CodeFixTitle);

                model.Enabled = IsEnabled(model.Id);

                items.Add(model);
            }
        }