public static void OnCodeBlockStarted(CodeBlockStartAnalysisContext <SyntaxKind> context)
            {
                Action <Action <SyntaxNodeAnalysisContext>, ImmutableArray <SyntaxKind> > registerMethod =
                    (action, Kinds) => context.RegisterSyntaxNodeAction(action, Kinds);
                var analyzer = new NodeAnalyzer();

                analyzer.Initialize(registerMethod);
            }
 public override void Initialize(AnalysisContext context)
 {
     if (_isCodeBlockAnalyzer)
     {
         context.RegisterCodeBlockStartAction <SyntaxKind>(OnCodeBlockStarted);
         context.RegisterCodeBlockAction(OnCodeBlockEnded);
     }
     else
     {
         Action <Action <SyntaxNodeAnalysisContext>, ImmutableArray <SyntaxKind> > registerMethod =
             (action, Kinds) => context.RegisterSyntaxNodeAction(action, Kinds);
         var analyzer = new NodeAnalyzer();
         analyzer.Initialize(registerMethod);
     }
 }
Ejemplo n.º 3
0
 public static void OnCodeBlockStarted(CodeBlockStartAnalysisContext<SyntaxKind> context)
 {
     Action<Action<SyntaxNodeAnalysisContext>, ImmutableArray<SyntaxKind>> registerMethod =
         (action, Kinds) => context.RegisterSyntaxNodeAction(action, Kinds);
     var analyzer = new NodeAnalyzer();
     analyzer.Initialize(registerMethod);
 }
Ejemplo n.º 4
0
 public override void Initialize(AnalysisContext context)
 {
     if (_isCodeBlockAnalyzer)
     {
         context.RegisterCodeBlockStartAction<SyntaxKind>(OnCodeBlockStarted);
         context.RegisterCodeBlockAction(OnCodeBlockEnded);
     }
     else
     {
         Action<Action<SyntaxNodeAnalysisContext>, ImmutableArray<SyntaxKind>> registerMethod =
             (action, Kinds) => context.RegisterSyntaxNodeAction(action, Kinds);
         var analyzer = new NodeAnalyzer();
         analyzer.Initialize(registerMethod);
     }
 }