コード例 #1
0
        private static void WriteDelegateInvocation(CodeTextBuilder code, DelegateInvocationExpression expression)
        {
            WriteExpression(code, expression.Delegate);

            code.WriteListStart(opener: "(", separator: ", ", closer: ")");

            foreach (var argument in expression.Arguments)
            {
                code.WriteListItem();
                WriteExpression(code, argument.Expression);
            }

            code.WriteListEnd();
        }
コード例 #2
0
        public virtual DelegateInvocationExpression RewriteDelegateInvocationExpression(DelegateInvocationExpression expression)
        {
            var newDelegate  = expression.Delegate.AcceptRewriter(this);
            var newArguments = RewriteArguments(expression.Arguments);

            if (newDelegate != expression.Delegate || newArguments != expression.Arguments)
            {
                return(new DelegateInvocationExpression {
                    Bindings = new BindingCollection(expression.Bindings),
                    Delegate = newDelegate,
                    Arguments = newArguments,
                    Type = expression.Type
                });
            }

            return(expression);
        }