Update() public method

Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.
public Update ( IEnumerable initializers ) : MemberListBinding
initializers IEnumerable The property of the result.
return MemberListBinding
コード例 #1
0
        /// <summary>
        ///     Visits the children of the <see cref="MemberListBinding" />.
        /// </summary>
        /// <param name="node">The expression to visit.</param>
        /// <returns>
        ///     The modified expression, if it or any subexpression was modified;
        ///     otherwise, returns the original expression.
        /// </returns>
        protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding node)
        {
            if (node == null)
            {
                throw new ArgumentNullException(nameof(node));
            }

            return(node.Update(Visit(node.Initializers, VisitElementInit)));
        }
コード例 #2
0
        public MemberListBindingExpressionTree Visit(MemberListBinding node)
        {
            CheckChildrenCount(node.Initializers.Count);

            var i = ExtractChildInitializers(0, node.Initializers.Count);

            var memberListBinding = node.Update(i);

            return(new MemberListBindingExpressionTree(memberListBinding, _children.Cast <ElementInitExpressionTree>()));
        }
コード例 #3
0
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     return(node.Update(Visit(node.Initializers, VisitElementInit)));
 }
コード例 #4
0
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     return(node.Update(Visit <ElementInit>(node.Initializers, new Func <ElementInit, ElementInit>(this.VisitElementInit))));
 }