Пример #1
0
        private void OnCompilationStartAction(CompilationStartAnalysisContext context, Configuration config)
        {
            var taintAnalyzer = new VbCodeEvaluation(VBSyntaxNodeHelper.Default, config, Extensions);

            context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, VB.SyntaxKind.SubBlock);
            context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, VB.SyntaxKind.FunctionBlock);
            context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, VB.SyntaxKind.ConstructorBlock);
            context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, VB.SyntaxKind.PropertyBlock);
        }
Пример #2
0
 public override void Initialize(AnalysisContext analysisContext)
 {
     analysisContext.RegisterCompilationStartAction(
         context =>
     {
         var taintAnalyzer = new VbCodeEvaluation(VBSyntaxNodeHelper.Default,
                                                  ConfigurationManager.Instance
                                                  .GetUpdatedProjectConfiguration(context.Options.AdditionalFiles));
         context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, VB.SyntaxKind.SubBlock);
         context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, VB.SyntaxKind.FunctionBlock);
         context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, VB.SyntaxKind.ConstructorBlock);
         context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, VB.SyntaxKind.PropertyBlock);
     });
 }