CodeTiger.CodeAnalysis/Analyzers/Layout/BinaryOperatorLayoutAnalyzer.cs
/// <summary>
/// Registers actions in an analysis context.
/// </summary>
/// <param name="context">The context to register actions in.</param>
/// <remarks>This method should only be called once, at the start of a session.</remarks>
Registers actions in an analysis context.
Registers actions in an analysis context .
public override void Initialize(AnalysisContext context)
        {
            Guard.ArgumentIsNotNull(nameof(context), context);
            context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
            context.EnableConcurrentExecution();
            context.RegisterSyntaxNodeAction(AnalyzeMemberAccessExpression,
                SyntaxKind.SimpleMemberAccessExpression, SyntaxKind.PointerMemberAccessExpression);
            context.RegisterSyntaxNodeAction(AnalyzeQualifiedNameSyntax, SyntaxKind.QualifiedName);
            context.RegisterSyntaxNodeAction(AnalyzeBinaryExpression, SyntaxKind.AddExpression,
                SyntaxKind.SubtractExpression, SyntaxKind.MultiplyExpression, SyntaxKind.DivideExpression,
                SyntaxKind.ModuloExpression, SyntaxKind.LessThanExpression, SyntaxKind.GreaterThanExpression,
                SyntaxKind.LessThanOrEqualExpression, SyntaxKind.GreaterThanOrEqualExpression,
                SyntaxKind.IsExpression, SyntaxKind.AsExpression, SyntaxKind.EqualsExpression,
                SyntaxKind.NotEqualsExpression, SyntaxKind.LeftShiftExpression, SyntaxKind.RightShiftExpression,
                SyntaxKind.BitwiseAndExpression, SyntaxKind.BitwiseOrExpression, SyntaxKind.LogicalAndExpression,
                SyntaxKind.LogicalOrExpression, SyntaxKind.ExclusiveOrExpression, SyntaxKind.CoalesceExpression);
            context.RegisterSyntaxNodeAction(AnalyzeConditionalExpression, SyntaxKind.ConditionalExpression);
            context.RegisterSyntaxNodeAction(AnalyzeAssignmentExpression, SyntaxKind.SimpleAssignmentExpression,
                SyntaxKind.AddAssignmentExpression, SyntaxKind.SubtractAssignmentExpression,
                SyntaxKind.MultiplyAssignmentExpression, SyntaxKind.DivideAssignmentExpression,
                SyntaxKind.ModuloAssignmentExpression, SyntaxKind.AndAssignmentExpression,
                SyntaxKind.OrAssignmentExpression, SyntaxKind.ExclusiveOrAssignmentExpression,
                SyntaxKind.LeftShiftAssignmentExpression, SyntaxKind.RightShiftAssignmentExpression);
            context.RegisterSyntaxNodeAction(AnalyzeLambdaExpression, SyntaxKind.SimpleLambdaExpression,
                SyntaxKind.ParenthesizedLambdaExpression);
        }
public override void Initialize ( AnalysisContext context ) { Guard . ArgumentIsNotNull ( nameof ( context ) , context ) ; context . ConfigureGeneratedCodeAnalysis ( GeneratedCodeAnalysisFlags . None ) ; context . EnableConcurrentExecution ( ) ; context . RegisterSyntaxNodeAction ( AnalyzeMemberAccessExpression , SyntaxKind . SimpleMemberAccessExpression , SyntaxKind . PointerMemberAccessExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeQualifiedNameSyntax , SyntaxKind . QualifiedName ) ; context . RegisterSyntaxNodeAction ( AnalyzeBinaryExpression , SyntaxKind . AddExpression , SyntaxKind . SubtractExpression , SyntaxKind . MultiplyExpression , SyntaxKind . DivideExpression , SyntaxKind . ModuloExpression , SyntaxKind . LessThanExpression , SyntaxKind . GreaterThanExpression , SyntaxKind . LessThanOrEqualExpression , SyntaxKind . GreaterThanOrEqualExpression , SyntaxKind . IsExpression , SyntaxKind . AsExpression , SyntaxKind . EqualsExpression , SyntaxKind . NotEqualsExpression , SyntaxKind . LeftShiftExpression , SyntaxKind . RightShiftExpression , SyntaxKind . BitwiseAndExpression , SyntaxKind . BitwiseOrExpression , SyntaxKind . LogicalAndExpression , SyntaxKind . LogicalOrExpression , SyntaxKind . ExclusiveOrExpression , SyntaxKind . CoalesceExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeConditionalExpression , SyntaxKind . ConditionalExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeAssignmentExpression , SyntaxKind . SimpleAssignmentExpression , SyntaxKind . AddAssignmentExpression , SyntaxKind . SubtractAssignmentExpression , SyntaxKind . MultiplyAssignmentExpression , SyntaxKind . DivideAssignmentExpression , SyntaxKind . ModuloAssignmentExpression , SyntaxKind . AndAssignmentExpression , SyntaxKind . OrAssignmentExpression , SyntaxKind . ExclusiveOrAssignmentExpression , SyntaxKind . LeftShiftAssignmentExpression , SyntaxKind . RightShiftAssignmentExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeLambdaExpression , SyntaxKind . SimpleLambdaExpression , SyntaxKind . ParenthesizedLambdaExpression ) ; }
Registers actions in an analysis context.
Registers actions in an analysis context .
context
AnalysisContext
The context to register actions in.
The context to register actions in .
remarks
This method should only be called once, at the start of a session.
This method should only be called once at the start of a session .