internal Analyzers(SecurityAnalyzer analyzer) { if (!analyzer.GetType().GetCustomAttributes(typeof(SecurityAnalyzerAttribute), false).Any()) { throw new Exception("Analyzer is derived from SecurityAnalyzer, but doesn't have 'SecurityAnalyzer' attribute."); } Workers = new Lazy <List <SecurityAnalyzer> >(() => new List <SecurityAnalyzer> { analyzer }); Diagnostics = new Lazy <ImmutableArray <DiagnosticDescriptor> >(InitDiagnostics); }
internal Analyzers(SecurityAnalyzer analyzer) { if (!analyzer.GetType().GetCustomAttributes(typeof(SecurityAnalyzerAttribute), false).Any()) { throw new Exception("Analyzer is derived from SecurityAnalyzer, but doesn't have 'SecurityAnalyzer' attribute."); } Workers = new List <SecurityAnalyzer> { analyzer }; InitDiagnostics(); }