CodeTiger.CodeAnalysis/Analyzers/Layout/BraceLayoutAnalyzer.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(AnalyzeNamespaceDeclaration,
                SyntaxKind.NamespaceDeclaration);
            context.RegisterSyntaxNodeAction(AnalyzeComplexElementInitializerExpression,
                SyntaxKind.ComplexElementInitializerExpression);
            context.RegisterSyntaxNodeAction(AnalyzeArrayCreationExpression,
                SyntaxKind.ArrayCreationExpression);
            context.RegisterSyntaxNodeAction(AnalyzeObjectCreationExpression,
                SyntaxKind.ObjectCreationExpression);
            context.RegisterSyntaxNodeAction(AnalyzeAnonymousObjectCreationExpression,
                SyntaxKind.AnonymousObjectCreationExpression);
            context.RegisterSyntaxNodeAction(AnalyzeBlock, SyntaxKind.Block);
            context.RegisterSyntaxNodeAction(AnalyzeSwitchStatement, SyntaxKind.SwitchStatement);
            context.RegisterSyntaxNodeAction(AnalyzeTypeDeclaration, SyntaxKind.ClassDeclaration,
                SyntaxKind.StructDeclaration, SyntaxKind.InterfaceDeclaration, SyntaxKind.EnumDeclaration);
            context.RegisterSyntaxNodeAction(AnalyzeAccessorList, SyntaxKind.AccessorList);
            context.RegisterSyntaxNodeAction(AnalyzeIfStatement, SyntaxKind.IfStatement);
            context.RegisterSyntaxNodeAction(AnalyzeElseClause, SyntaxKind.ElseClause);
            context.RegisterSyntaxNodeAction(AnalyzeForStatement, SyntaxKind.ForStatement);
            context.RegisterSyntaxNodeAction(AnalyzeForEachStatement, SyntaxKind.ForEachStatement);
            context.RegisterSyntaxNodeAction(AnalyzeWhileStatement, SyntaxKind.WhileStatement);
            context.RegisterSyntaxNodeAction(AnalyzeDoStatement, SyntaxKind.DoStatement);
            context.RegisterSyntaxNodeAction(AnalyzeUsingStatement, SyntaxKind.UsingStatement);
        }
public override void Initialize ( AnalysisContext context ) { Guard . ArgumentIsNotNull ( nameof ( context ) , context ) ; context . ConfigureGeneratedCodeAnalysis ( GeneratedCodeAnalysisFlags . None ) ; context . EnableConcurrentExecution ( ) ; context . RegisterSyntaxNodeAction ( AnalyzeNamespaceDeclaration , SyntaxKind . NamespaceDeclaration ) ; context . RegisterSyntaxNodeAction ( AnalyzeComplexElementInitializerExpression , SyntaxKind . ComplexElementInitializerExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeArrayCreationExpression , SyntaxKind . ArrayCreationExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeObjectCreationExpression , SyntaxKind . ObjectCreationExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeAnonymousObjectCreationExpression , SyntaxKind . AnonymousObjectCreationExpression ) ; context . RegisterSyntaxNodeAction ( AnalyzeBlock , SyntaxKind . Block ) ; context . RegisterSyntaxNodeAction ( AnalyzeSwitchStatement , SyntaxKind . SwitchStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeTypeDeclaration , SyntaxKind . ClassDeclaration , SyntaxKind . StructDeclaration , SyntaxKind . InterfaceDeclaration , SyntaxKind . EnumDeclaration ) ; context . RegisterSyntaxNodeAction ( AnalyzeAccessorList , SyntaxKind . AccessorList ) ; context . RegisterSyntaxNodeAction ( AnalyzeIfStatement , SyntaxKind . IfStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeElseClause , SyntaxKind . ElseClause ) ; context . RegisterSyntaxNodeAction ( AnalyzeForStatement , SyntaxKind . ForStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeForEachStatement , SyntaxKind . ForEachStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeWhileStatement , SyntaxKind . WhileStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeDoStatement , SyntaxKind . DoStatement ) ; context . RegisterSyntaxNodeAction ( AnalyzeUsingStatement , SyntaxKind . UsingStatement ) ; }
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 .