Пример #1
0
        public override SyntaxNode VisitForEachStatement(ForEachStatementSyntax node)
        {
            var statement = GetStatementsAsBlock(node);
            var line      = GetLineNumber(statement) + 2;
            var updated   = Block(new[] { ThrowIfCancelled.WithTrailingTrivia(GetLineDirective(line)) }.Concat(statement.Statements));

            return(base.VisitForEachStatement(node.ReplaceNode(node.Statement, updated)));
        }