Exemplo n.º 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;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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;
 }
Exemplo n.º 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));
        }
Exemplo n.º 12
0
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     throw new NotImplementedException();
 }
 protected virtual new MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     return(default(MemberMemberBinding));
 }
Exemplo n.º 14
0
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     return((MemberMemberBinding)null);
 }
Exemplo n.º 15
0
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     var bindings = VisitBindingList(binding.Bindings);
     return !Equals(bindings, binding.Bindings) ? Expression.MemberBind(binding.Member, bindings) : binding;
 }
Exemplo n.º 16
0
 /// <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);
 }
Exemplo n.º 17
0
 protected virtual bool VisitMemberMemberBinding(MemberMemberBinding binding, MemberMemberBinding binding2)
 {
     return(binding.Member == binding2.Member &&
            VisitBindingList(binding.Bindings, binding2.Bindings));
 }
Exemplo n.º 18
0
 protected virtual bool CompareMemberMemberBinding(MemberMemberBinding a, MemberMemberBinding b)
 {
     return a.Member == b.Member
         && this.CompareBindingList(a.Bindings, b.Bindings);
 }
Exemplo n.º 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;
 }
Exemplo n.º 25
0
 protected virtual void VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     VisitBindingList(binding.Bindings);
 }
    public virtual bool IsEvaluatableMemberMemberBinding (MemberMemberBinding node)
    {
      ArgumentUtility.CheckNotNull ("node", node);

      return true;
    }
Exemplo n.º 27
0
 /// <summary>
 /// Visits a MemberMemberBinding 
 /// </summary>
 /// <param name="binding">MemberMemberBinding Expression</param>
 protected virtual void VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     VisitBindingList(binding.Bindings);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 30
0
        /// <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;
 }
Exemplo n.º 32
0
		protected override void VisitMemberMemberBinding (MemberMemberBinding binding)
		{
			var value = Pop ();
			Push (value);
			VisitMemberInfo (binding.Member);
			VisitBindingList (binding.Bindings);
			Pop ();
			Push (value);
		}
Exemplo n.º 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)));
 }
Exemplo n.º 34
0
 protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     throw new NotSupportedException();
 }
Exemplo n.º 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();
 }
Exemplo n.º 38
0
 protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
 {
     IEnumerable<MemberBinding> bindings = this.VisitBindingList(binding.Bindings);
     return this.UpdateMemberMemberBinding(binding, binding.Member, bindings);
 }
Exemplo n.º 39
0
 /// <inheritdoc />
 protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) => Expression.MemberBind(binding.Member, VisitBindingList(binding.Bindings));
Exemplo n.º 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)
 {
 }
Exemplo n.º 42
0
 private static MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 43
0
 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;
 }
Exemplo n.º 47
0
        private MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
        {
            var bindings = VisitBindingList(binding.Bindings);

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