CodeTiger.CodeAnalysis/Analyzers/Layout/ParenthesisLayoutAnalyzer.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(AnalyzeConstructorInitializer, SyntaxKind.BaseConstructorInitializer,
                SyntaxKind.ThisConstructorInitializer);
            context.RegisterSyntaxNodeAction(AnalyzeCatchClause, SyntaxKind.CatchClause);
            context.RegisterSyntaxNodeAction(AnalyzeDefaultExpression, SyntaxKind.DefaultExpression);
            context.RegisterSyntaxNodeAction(AnalyzeFixedStatement, SyntaxKind.FixedStatement);
            context.RegisterSyntaxNodeAction(AnalyzeForStatement, SyntaxKind.ForStatement);
            context.RegisterSyntaxNodeAction(AnalyzeForEachStatement, SyntaxKind.ForEachStatement);
            context.RegisterSyntaxNodeAction(AnalyzeIfStatement, SyntaxKind.IfStatement);
            context.RegisterSyntaxNodeAction(AnalyzeLockStatement, SyntaxKind.LockStatement);
            context.RegisterSyntaxNodeAction(AnalyzeSizeOfExpression, SyntaxKind.SizeOfExpression);
            context.RegisterSyntaxNodeAction(AnalyzeSwitchStatement, SyntaxKind.SwitchStatement);
            context.RegisterSyntaxNodeAction(AnalyzeTypeOfExpression, SyntaxKind.TypeOfExpression);
            context.RegisterSyntaxNodeAction(AnalyzeUsingStatement, SyntaxKind.UsingStatement);
            context.RegisterSyntaxNodeAction(AnalyzeWhileStatement, SyntaxKind.WhileStatement);
            context.RegisterSyntaxNodeAction(AnalyzeInvocationExpression, SyntaxKind.InvocationExpression);
            context.RegisterSyntaxNodeAction(AnalyzeObjectCreationExpression, SyntaxKind.ObjectCreationExpression);
            context.RegisterSyntaxNodeAction(AnalyzeCastExpression, SyntaxKind.CastExpression);
            context.RegisterSyntaxNodeAction(AnalyzeConstructorDeclaration, SyntaxKind.ConstructorDeclaration);
            context.RegisterSyntaxNodeAction(AnalyzeConversionOperatorDeclaration,
                SyntaxKind.ConversionOperatorDeclaration);
            context.RegisterSyntaxNodeAction(AnalyzeDestructorDeclaration, SyntaxKind.DestructorDeclaration);
            context.RegisterSyntaxNodeAction(AnalyzeMethodDeclaration, SyntaxKind.MethodDeclaration);
            context.RegisterSyntaxNodeAction(AnalyzeOperatorDeclaration, SyntaxKind.OperatorDeclaration);
            context.RegisterSyntaxNodeAction(AnalyzeParenthesizedLambdaExpression,
                SyntaxKind.ParenthesizedLambdaExpression);
        }
public override void Initialize ( AnalysisContext context ) { Guard . ArgumentIsNotNull ( nameof ( context ) , context ) ; context . ConfigureGeneratedCodeAnalysis ( GeneratedCodeAnalysisFlags . None ) ; context . EnableConcurrentExecution ( ) ; context . RegisterSyntaxNodeAction ( AnalyzeConstructorInitializer , SyntaxKind . BaseConstructorInitializer , SyntaxKind . ThisConstructorInitializer ) ; context . RegisterSyntaxNodeAction ( AnalyzeCatchClause , SyntaxKind . CatchClause ) ; context . RegisterSyntaxNodeAction ( AnalyzeDefaultExpression , SyntaxKind . DefaultExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeFixedStatement , SyntaxKind . FixedStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeForStatement , SyntaxKind . ForStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeForEachStatement , SyntaxKind . ForEachStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeIfStatement , SyntaxKind . IfStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeLockStatement , SyntaxKind . LockStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeSizeOfExpression , SyntaxKind . SizeOfExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeSwitchStatement , SyntaxKind . SwitchStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeTypeOfExpression , SyntaxKind . TypeOfExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeUsingStatement , SyntaxKind . UsingStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeWhileStatement , SyntaxKind . WhileStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeInvocationExpression , SyntaxKind . InvocationExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeObjectCreationExpression , SyntaxKind . ObjectCreationExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeCastExpression , SyntaxKind . CastExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeConstructorDeclaration , SyntaxKind . ConstructorDeclaration ) ; context . RegisterSyntaxNodeAction ( AnalyzeConversionOperatorDeclaration , SyntaxKind . ConversionOperatorDeclaration ) ; context . RegisterSyntaxNodeAction ( AnalyzeDestructorDeclaration , SyntaxKind . DestructorDeclaration ) ; context . RegisterSyntaxNodeAction ( AnalyzeMethodDeclaration , SyntaxKind . MethodDeclaration ) ; context . RegisterSyntaxNodeAction ( AnalyzeOperatorDeclaration , SyntaxKind . OperatorDeclaration ) ; context . RegisterSyntaxNodeAction ( AnalyzeParenthesizedLambdaExpression , 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 .