public override void Initialize(AnalysisContext context)
 {
     context.RegisterCompilationStartAction(
         compileContext =>
     {
         var notSupportedExceptionName = compileContext.Compilation.GetTypeByMetadataName("System.NotSupportedException");
         compileContext.RegisterSyntaxNodeAction(
             symbolContext => LSPViolatingExceptionReporter.ReportLSPViolatingExceptionIfThrown(symbolContext, notSupportedExceptionName, Rule),
             SyntaxKind.ThrowStatement);
     });
 }
Пример #2
0
 public override void Initialize(AnalysisContext context)
 {
     context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
     context.EnableConcurrentExecution();
     context.RegisterCompilationStartAction(
         compileContext =>
     {
         var notImplementedExceptionName = compileContext.Compilation.GetTypeByMetadataName("System.NotImplementedException");
         compileContext.RegisterSyntaxNodeAction(
             symbolContext => LSPViolatingExceptionReporter.ReportLSPViolatingExceptionIfThrown(symbolContext, notImplementedExceptionName, Rule),
             SyntaxKind.ThrowStatement);
     });
 }