Example #1
0
 public static MemberMemberBinding Serialize(E.MemberMemberBinding binding)
 {
     return(new MemberMemberBinding()
     {
         Member = MemberRef.Serialize(binding.Member),
         Bindings = binding.Bindings.Select(Serialize).ToArray(),
     });
 }
        protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding expression)
        {
            MemberMemberBinding 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.Bindings;
            this.VisitBindingList(expression.Bindings);
            if (!this.result)
            {
                return expression;
            }

            this.currentObject = current;
            return expression;
        }
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding, Stack<string> stack, Stack<IElasticPropertyAttribute> properties)
 {
     IEnumerable<MemberBinding> bindings = this.VisitBindingList(binding.Bindings, stack, properties);
     if (bindings != binding.Bindings)
     {
         return Expression.MemberBind(binding.Member, bindings);
     }
     return binding;
 }
 internal virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     var bindings = VisitBindingList(binding.Bindings);
     if (bindings != binding.Bindings)
     {
         return Expression.MemberBind(binding.Member, bindings);
     }
     return binding;
 }
Example #5
0
 protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) => InvokeEvent(MemberMemberBindingVisited, binding, base.VisitMemberMemberBinding);
        /// <summary>
        /// Visit a member binding expression.
        /// </summary>
        /// <param name="memberBindingExp"></param>
        /// <returns></returns>
        protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding memberBindingExp)
        {
            IEnumerable<MemberBinding> bindings = VisitBindingList(memberBindingExp.Bindings);

            return bindings != memberBindingExp.Bindings ? Expression.MemberBind(memberBindingExp.Member, bindings) : memberBindingExp;
        }
Example #7
0
 protected MemberMemberBinding UpdateMemberMemberBinding(MemberMemberBinding binding, MemberInfo member, IEnumerable<MemberBinding> bindings)
 {
     if (bindings != binding.Bindings || member != binding.Member)
     {
         return Expression.MemberBind(member, bindings);
     }
     return binding;
 }
 /// <summary>
 /// Visits a MemberMemberBinding.
 /// </summary>
 /// <param name="node">The MemberMemberBinding.</param>
 /// <returns>The MemberMemberBinding.</returns>
 protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     _sb.Append("<MemberMemberBinding>");
     return node;
 }
Example #9
0
        protected virtual new MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
        {
            Contract.Requires(node != null);

            return(default(MemberMemberBinding));
        }
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     return(node.Update(Visit <MemberBinding>(node.Bindings, new Func <MemberBinding, MemberBinding>(this.VisitMemberBinding))));
 }
        /// <summary>
        /// Makes a member binding slim object representing a MemberMemberBinding with the given children.
        /// </summary>
        /// <param name="node">Original member member binding.</param>
        /// <param name="bindings">Slim member bindings.</param>
        /// <returns>Slim representation of the original member member binding.</returns>
        protected override MemberMemberBindingSlim MakeMemberMemberBinding(MemberMemberBinding node, ReadOnlyCollection <MemberBindingSlim> bindings)
        {
            var member = MakeMember(node.Member);

            return(_factory.MemberBind(member, bindings));
        }
Example #12
0
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     throw new NotImplementedException();
 }
 protected virtual new MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     return(default(MemberMemberBinding));
 }
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     return((MemberMemberBinding)null);
 }
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     var bindings = VisitBindingList(binding.Bindings);
     return !Equals(bindings, binding.Bindings) ? Expression.MemberBind(binding.Member, bindings) : binding;
 }
 /// <summary>
 /// Constructor with an <see cref="MemberMemberBinding"/> and an <see cref="ExpressionConverter"/>.
 /// </summary>
 /// <param name="memberMemberBinding">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 SerializableMemberMemberBinding(MemberMemberBinding memberMemberBinding, ExpressionConverter expConverter)
     : base(memberMemberBinding, expConverter)
 {
     Bindings = expConverter.ConvertToSerializableObjectCollection<SerializableMemberBinding>(memberMemberBinding.Bindings);
 }
Example #17
0
 protected virtual bool VisitMemberMemberBinding(MemberMemberBinding binding, MemberMemberBinding binding2)
 {
     return(binding.Member == binding2.Member &&
            VisitBindingList(binding.Bindings, binding2.Bindings));
 }
 protected virtual bool CompareMemberMemberBinding(MemberMemberBinding a, MemberMemberBinding b)
 {
     return a.Member == b.Member
         && this.CompareBindingList(a.Bindings, b.Bindings);
 }
Example #19
0
        protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
        {
            var bindings = VisitBindingList(binding.Bindings);

            return(bindings != binding.Bindings ? Expression.MemberBind(binding.Member, bindings) : binding);
        }
 public MemberMemberBindingNode(NodeContext factory, MemberMemberBinding memberMemberBinding) : base(factory, memberMemberBinding.BindingType, memberMemberBinding.Member)
 {
     Bindings = new MemberBindingNodeList(factory, memberMemberBinding.Bindings);
 }
        protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
        {
            var bindings = Visit <MemberBinding>(node.Bindings, n => this.VisitMemberBinding(n));

            return(UpdateMemberMemberBinding(node, node.Member, bindings));
        }
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     IEnumerable<MemberBinding> bindings = VisitBindingList(binding.Bindings);
     // ReSharper disable once PossibleUnintendedReferenceComparison
     if(bindings != binding.Bindings)
     {
         return System.Linq.Expressions.Expression.MemberBind(binding.Member, bindings);
     }
     return binding;
 }
        protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
        {
            var bindings = Visit(nameof(node.Bindings), node.Bindings, Visit);

            return(PushBinding(node, new XAttribute(nameof(node.Member), node.Member), bindings));
        }
 public MemberMemberBindingMutator(MemberMemberBinding memberMemberBinding)
 {
     MemberMemberBinding = memberMemberBinding;
 }
Example #25
0
 protected virtual void VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     VisitBindingList(binding.Bindings);
 }
    public virtual bool IsEvaluatableMemberMemberBinding (MemberMemberBinding node)
    {
      ArgumentUtility.CheckNotNull ("node", node);

      return true;
    }
Example #27
0
 /// <summary>
 /// Visits a MemberMemberBinding 
 /// </summary>
 /// <param name="binding">MemberMemberBinding Expression</param>
 protected virtual void VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     VisitBindingList(binding.Bindings);
 }
Example #28
0
 /// <summary>
 /// Visits a MemberMemberBinding.
 /// </summary>
 /// <param name="node">The MemberMemberBinding.</param>
 /// <returns>The MemberMemberBinding (possibly modified).</returns>
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     IEnumerable<MemberBinding> bindings = VisitMemberBindingList(node.Bindings);
     return UpdateMemberMemberBinding(node, node.Member, bindings);
 }
Example #29
0
        /// <summary>
        /// Visits the children of the <see cref="MemberMemberBinding" />.
        /// </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 MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
        {
            var bindings = this.VisitBindingList(node.Bindings);

            return(bindings != node.Bindings ? Expression.MemberBind(node.Member, bindings) : node);
        }
        /// <summary>
        /// Visits the children of the <c>MemberMemberBinding</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 MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
        {
            if (binding == null)
                throw new ArgumentNullException("binding");

            var bindings = VisitBindingList(binding.Bindings);
            return bindings == binding.Bindings ? binding : Expression.MemberBind(binding.Member, bindings);
        }
 /// <summary>
 /// Visits a MemberMemberBinding.
 /// </summary>
 /// <param name="node">The MemberMemberBinding.</param>
 /// <returns>The MemberMemberBinding (possibly modified).</returns>
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     IEnumerable<MemberBinding> bindings = this.VisitMemberBindingList(node.Bindings);
     if (bindings != node.Bindings)
     {
         return Expression.MemberBind(node.Member, bindings);
     }
     return node;
 }
Example #32
0
		protected override void VisitMemberMemberBinding (MemberMemberBinding binding)
		{
			var value = Pop ();
			Push (value);
			VisitMemberInfo (binding.Member);
			VisitBindingList (binding.Bindings);
			Pop ();
			Push (value);
		}
Example #33
0
 /// <summary>
 /// Visits the children of the <see cref="MemberMemberBinding" />.
 /// </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 MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     return(node.Update(Visit(node.Bindings, VisitMemberBinding)));
 }
 protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     throw new NotSupportedException();
 }
Example #35
0
 private Expression VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     foreach (var p in this.VisitBindingList(binding.Bindings))
     {
         if (p != null)
             return p;
     }
     return null;
 }
 /// <summary>
 /// MemberMemberBinding visit method
 /// </summary>
 /// <param name="binding">The MemberMemberBinding to visit</param>
 /// <returns>The visited MemberMemberBinding</returns>
 internal override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     this.VisitBindingList(binding.Bindings);
     return binding;
 }
 protected virtual string VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     throw new NotSupportedException();
 }
Example #38
0
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     IEnumerable<MemberBinding> bindings = this.VisitBindingList(binding.Bindings);
     return this.UpdateMemberMemberBinding(binding, binding.Member, bindings);
 }
Example #39
0
 /// <inheritdoc />
 protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) => Expression.MemberBind(binding.Member, VisitBindingList(binding.Bindings));
Example #40
0
 protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     this.Write(binding.Member.Name);
     this.Write(" = {");
     this.WriteLine(Indentation.Inner);
     this.VisitBindingList(binding.Bindings);
     this.WriteLine(Indentation.Outer);
     this.Write("}");
     return binding;
 }
 protected virtual void PVisitMemberMemberBinding(MemberMemberBinding binding)
 {
 }
Example #42
0
 private static MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     throw new NotImplementedException();
 }
 protected virtual void VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     this.VisitBindingList(binding.Bindings);
     throw new NotImplementedException ();
 }
 /// <summary>
 /// Visits a MemberMemberBinding.
 /// </summary>
 /// <param name="node">The MemberMemberBinding.</param>
 /// <returns>The MemberMemberBinding.</returns>
 protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// MemberMemberBinding visit method
 /// </summary>
 /// <param name="binding">The MemberMemberBinding to visit</param>
 /// <returns>The visited MemberMemberBinding</returns>
 internal override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Visits a MemberMemberBinding.
 /// </summary>
 /// <param name="binding">The MemberMemberBinding.</param>
 /// <returns>The MemberMemberBinding (possibly modified).</returns>
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     IEnumerable<MemberBinding> bindings = this.VisitBindingList(binding.Bindings);
     if (bindings != binding.Bindings)
     {
         return Expression.MemberBind(binding.Member, bindings);
     }
     return binding;
 }
        private MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
        {
            var bindings = VisitBindingList(binding.Bindings);

            return(bindings != binding.Bindings ? Expression.MemberBind(binding.Member, bindings) : binding);
        }