public Inspector(IGeneralConfigService configService, IInspectionProvider inspectionProvider) { _inspections = inspectionProvider.Inspections.ToList(); _configService = configService; configService.SettingsChanged += ConfigServiceSettingsChanged; }
public CodeInspectionConfigProvider(IPersistanceService<CodeInspectionSettings> persister, IInspectionProvider inspectionProvider) { _persister = persister; _foundInspectionNames = inspectionProvider.Inspections.Select(inspection => inspection.Name).ToHashSet(); _defaultSettings = new DefaultSettings<CodeInspectionSettings>().Default; // Ignore settings for unknown inpections, for example when using the Experimental attribute _defaultSettings.CodeInspections = _defaultSettings.CodeInspections.Where(setting => _foundInspectionNames.Contains(setting.Name)).ToHashSet(); var defaultNames = _defaultSettings.CodeInspections.Select(x => x.Name); var nonDefaultInspections = inspectionProvider.Inspections.Where(inspection => !defaultNames.Contains(inspection.Name)); _defaultSettings.CodeInspections.UnionWith(nonDefaultInspections.Select(inspection => new CodeInspectionSetting(inspection))); }
public Inspector(IConfigurationService <CodeInspectionSettings> configService, IInspectionProvider inspectionProvider) { _inspections = inspectionProvider.Inspections.ToList(); _configService = configService; configService.SettingsChanged += ConfigServiceSettingsChanged; }
public CodeInspectionConfigProvider(IPersistenceService <CodeInspectionSettings> persister, IInspectionProvider inspectionProvider) : base(persister, new DefaultSettings <CodeInspectionSettings, Properties.CodeInspectionDefaults>()) { foundInspectionNames = inspectionProvider.Inspections.Select(inspection => inspection.Name).ToHashSet(); // Ignore settings for unknown inspections, for example when using the Experimental attribute Defaults.Default.CodeInspections = Defaults.Default.CodeInspections.Where(setting => foundInspectionNames.Contains(setting.Name)).ToHashSet(); var defaultNames = Defaults.Default.CodeInspections.Select(x => x.Name); var nonDefaultInspections = inspectionProvider.Inspections.Where(inspection => !defaultNames.Contains(inspection.Name)); Defaults.Default.CodeInspections.UnionWith(nonDefaultInspections.Select(inspection => new CodeInspectionSetting(inspection))); }