Represents initializing the elements of a collection member of a newly created object.
Inheritance: MemberBinding
		protected override MemberListBinding VisitMemberListBinding(MemberListBinding binding)
		{
			this.output.Append(binding.Member.Name).Append(" = ");
			this.VisitElementInitializerList(binding.Initializers);

			return binding;
		}
 public static MemberListBinding Serialize(E.MemberListBinding binding)
 {
     return(new MemberListBinding()
     {
         Member = MemberRef.Serialize(binding.Member),
         Initializers = binding.Initializers.Select(ElementInit.Serialize).ToArray(),
     });
 }
 public EditableMemberListBinding(MemberListBinding member)
     : base(member.BindingType, member.Member)
 {
     Initializers = new EditableElementInitCollection();
     foreach (ElementInit e in member.Initializers)
     {
         Initializers.Add(new EditableElementInit(e));
     }
 }
 /// <summary>
 /// Visits a MemberListBinding.
 /// </summary>
 /// <param name="node">The MemberListBinding.</param>
 /// <returns>The MemberListBinding (possibly modified).</returns>
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     IEnumerable<ElementInit> initializers = this.VisitElementInitList(node.Initializers);
     if (initializers != node.Initializers)
     {
         return Expression.ListBind(node.Member, initializers);
     }
     return node;
 }
 /// <summary>
 /// Visits a MemberListBinding
 /// </summary>
 /// <param name="binding">MemberListBinding Expression</param>
 protected virtual void VisitMemberListBinding(MemberListBinding binding)
 {
     VisitElementInitializerList(binding.Initializers);
 }
Exemple #6
0
 protected virtual void VisitMemberListBinding(MemberListBinding binding)
 {
     this.VisitElementInitializerList(binding.Initializers);
 }
Exemple #7
0
        private Expression VisitMemberListBinding(MemberListBinding binding)
        {
            foreach (var p in this.VisitElementInitializerList(binding.Initializers))
            {
                if (p != null)
                    return p;
            }

            return null;
        }
 /// <summary>
 /// Visits a MemberListBinding.
 /// </summary>
 /// <param name="node">The MemberListBinding.</param>
 /// <returns>The MemberListBinding (possibly modified).</returns>
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     IEnumerable<ElementInit> initializers = VisitElementInitList(node.Initializers);
     return UpdateMemberListBinding(node, node.Member, initializers);
 }
 /// <summary>
 /// Visits a MemberListBinding.
 /// </summary>
 /// <param name="binding">The MemberListBinding.</param>
 /// <returns>The MemberListBinding (possibly modified).</returns>
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     IEnumerable<ElementInit> initializers = this.VisitElementInitializerList(binding.Initializers);
     if (initializers != binding.Initializers)
     {
         return Expression.ListBind(binding.Member, initializers);
     }
     return binding;
 }
 protected virtual void VisitMemberListBinding(MemberListBinding binding)
 {
     this.VisitElementInitializerList(binding.Initializers);
     throw new NotImplementedException ();
 }
 protected virtual void PVisitMemberListBinding(MemberListBinding binding)
 {
 }
 public MemberListBindingNode(INodeFactory factory, MemberListBinding memberListBinding)
     : base(factory, memberListBinding.BindingType, memberListBinding.Member)
 {
     this.Initializers = new ElementInitNodeList(this.Factory, memberListBinding.Initializers);
 }
Exemple #13
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)
 {
     return(node.Update(Visit(node.Initializers, VisitElementInit)));
 }
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     IEnumerable<ElementInit> initializers = this.VisitElementInitializerList(binding.Initializers);
     return this.UpdateMemberListBinding(binding, binding.Member, initializers);
 }
 /// <summary>
 /// MemberListBinding visit method
 /// </summary>
 /// <param name="binding">The MemberListBinding to visit</param>
 /// <returns>The visited MemberListBinding</returns>
 internal override MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     this.VisitElementInitializerList(binding.Initializers);
     return binding; 
 }
 protected virtual bool CompareMemberListBinding(MemberListBinding a, MemberListBinding b)
 {
     return a.Member == b.Member
         && this.CompareElementInitList(a.Initializers, b.Initializers);
 }
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     IEnumerable<ElementInit> initializers = VisitElementInitializerList(binding.Initializers);
     // ReSharper disable once PossibleUnintendedReferenceComparison
     if(initializers != binding.Initializers)
     {
         return System.Linq.Expressions.Expression.ListBind(binding.Member, initializers);
     }
     return binding;
 }
 internal virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     var initializers = VisitElementInitializerList(binding.Initializers);
     if (initializers != binding.Initializers)
     {
         return Expression.ListBind(binding.Member, initializers);
     }
     return binding;
 }
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     var initializers = VisitElementInitializerList(binding.Initializers);
     return !Equals(initializers, binding.Initializers) ? Expression.ListBind(binding.Member, initializers) : binding;
 }
 /// <summary>
 /// Constructor with an <see cref="MemberListBinding"/> and an <see cref="ExpressionConverter"/>.
 /// </summary>
 /// <param name="memberListBinding">The original, not serializable <see cref="MemberBinding"/>.</param>
 /// <param name="expConverter">The <see cref="ExpressionConverter"/> to convert contained <see cref="Expression">Expressions</see>.</param>
 public SerializableMemberListBinding(MemberListBinding memberListBinding, ExpressionConverter expConverter)
     : base(memberListBinding, expConverter)
 {
     Initializers = expConverter.ConvertToSerializableObjectCollection<SerializableElementInit>(memberListBinding.Initializers);
 }
        protected override MemberListBinding VisitMemberListBinding(MemberListBinding expression)
        {
            MemberListBinding current;
            if (!TryGetCurrent(expression, out current))
            {
                return expression;
            }

            if (!(this.result &= current.BindingType == expression.BindingType))
            {
                return expression;
            }

            if (!(this.result &= object.Equals(current.Member, expression.Member)))
            {
                return expression;
            }

            this.currentObject = current.Initializers;
            this.VisitElementInitializerList(expression.Initializers);
            if (!this.result)
            {
                return expression;
            }

            this.currentObject = current;
            return expression;
        }
        /// <summary>
        /// Visits the children of the <c>MemberListBinding</c>.
        /// </summary>
        /// <param name="binding">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 binding)
        {
            if (binding == null)
                throw new ArgumentNullException("binding");

            var initializers = VisitElementInitializerList(binding.Initializers);
            return initializers == binding.Initializers ? binding : Expression.ListBind(binding.Member, initializers);
        }
        private MemberListBinding VisitMemberListBinding(MemberListBinding binding)
        {
            var initializers = VisitElementInitializerList(binding.Initializers);

            return(initializers != binding.Initializers ? Expression.ListBind(binding.Member, initializers) : binding);
        }
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding, Stack<string> stack, Stack<IElasticPropertyAttribute> properties)
 {
     IEnumerable<ElementInit> initializers = this.VisitElementInitializerList(binding.Initializers, stack, properties);
     if (initializers != binding.Initializers)
     {
         return Expression.ListBind(binding.Member, initializers);
     }
     return binding;
 }
    public virtual bool IsEvaluatableMemberListBinding (MemberListBinding node)
    {
      ArgumentUtility.CheckNotNull ("node", node);

      return true;
    }
 protected MemberListBinding UpdateMemberListBinding(MemberListBinding binding, MemberInfo member, IEnumerable<ElementInit> initializers)
 {
     if (initializers != binding.Initializers || member != binding.Member)
     {
         return Expression.ListBind(member, initializers);
     }
     return binding;
 }
		protected override void VisitMemberListBinding (MemberListBinding binding)
		{
			var value = Pop ();
			Push (value);
			VisitMemberInfo (binding.Member);
			VisitElementInitializerList (binding.Initializers);
			Pop (); // pop the member
			Push (value); // push the original target
		}
 /// <summary>
 /// Visits a MemberListBinding.
 /// </summary>
 /// <param name="node">The MemberListBinding.</param>
 /// <returns>The MemberListBinding.</returns>
 protected override MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     throw new NotImplementedException();
 }
 private static MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     throw new NotImplementedException();
 }
        /// <summary>
        /// Visit a member list binding expression.
        /// </summary>
        /// <param name="listBindingExp"></param>
        /// <returns></returns>
        protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding listBindingExp)
        {
            IEnumerable<ElementInit> initializers = VisitElementInitializerList(listBindingExp.Initializers);

            return initializers != listBindingExp.Initializers ? Expression.ListBind(listBindingExp.Member, initializers) : listBindingExp;
        }
 /// <summary>
 /// Visits a MemberListBinding.
 /// </summary>
 /// <param name="node">The MemberListBinding.</param>
 /// <returns>The MemberListBinding.</returns>
 protected override MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     _sb.Append("<MemberListBinding>");
     return node;
 }
Exemple #32
-1
 protected override MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     this.Write(binding.Member.Name);
     this.Write(" = {");
     this.WriteLine(Indentation.Inner);
     this.VisitElementInitializerList(binding.Initializers);
     this.WriteLine(Indentation.Outer);
     this.Write("}");
     return binding;
 }
 protected virtual string VisitMemberListBinding(MemberListBinding binding)
 {
     throw new NotSupportedException();
 }
 /// <summary>
 /// MemberListBinding visit method
 /// </summary>
 /// <param name="binding">The MemberListBinding to visit</param>
 /// <returns>The visited MemberListBinding</returns>
 internal override MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     throw new NotImplementedException();
 }