コード例 #1
0
        public override void VisitEmptyStatement(EmptyStatementSyntax node)
        {
            base.VisitEmptyStatement(node);
            StatementsAnalyzer statementsAnalyzer = this;

            statementsAnalyzer.counter = checked (statementsAnalyzer.counter + 1);
        }
コード例 #2
0
        public override void VisitUsingDirective(UsingDirectiveSyntax node)
        {
            base.VisitUsingDirective(node);
            StatementsAnalyzer statementsAnalyzer = this;

            statementsAnalyzer.counter = checked (statementsAnalyzer.counter + 1);
        }
コード例 #3
0
        public override void VisitLocalDeclarationStatement(LocalDeclarationStatementSyntax node)
        {
            base.VisitLocalDeclarationStatement(node);
            StatementsAnalyzer statementsAnalyzer = this;

            statementsAnalyzer.counter = checked (statementsAnalyzer.counter + 1);
        }
コード例 #4
0
        public override void VisitInitializerExpression(InitializerExpressionSyntax node)
        {
            base.VisitInitializerExpression(node);
            StatementsAnalyzer count = this;

            count.counter = checked (count.counter + node.Expressions.Count);
        }
コード例 #5
0
 private void CalculateConstructorStatements(MemberNode node)
 {
     if (node.Kind == MemberKind.Constructor)
     {
         ConstructorDeclarationSyntax syntaxNode = node.SyntaxNode as ConstructorDeclarationSyntax;
         ConstructorDeclarationSyntax constructorDeclarationSyntax = syntaxNode;
         if (syntaxNode != null && constructorDeclarationSyntax.Initializer != null)
         {
             this.Visit(constructorDeclarationSyntax.Initializer);
             StatementsAnalyzer statementsAnalyzer = this;
             statementsAnalyzer.counter = checked (statementsAnalyzer.counter + 1);
         }
     }
 }
コード例 #6
0
        private void CalculateCompilerGeneratedPropertyStatements(MemberNode node)
        {
            switch (node.Kind)
            {
            case MemberKind.GetProperty:
            case MemberKind.SetProperty:
            {
                if (MemberBodySelector.FindBody(node) == null)
                {
                    StatementsAnalyzer statementsAnalyzer = this;
                    statementsAnalyzer.counter = checked (statementsAnalyzer.counter + 1);
                }
                return;
            }

            default:
            {
                return;
            }
            }
        }