protected override MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     Accumulate(binding.Member);
     return base.VisitMemberListBinding(binding);
 }
Пример #2
0
 private static MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     throw new NotImplementedException();
 }
        /// <summary>
        /// Visits the member list binding.
        /// </summary>
        private MemberBinding VisitMemberListBinding(MemberListBinding binding)
        {
            var initializers = binding.Initializers.Select(VisitElementInit);

            return(Expression.ListBind(binding.Member, initializers));
        }
Пример #4
0
 public virtual ReturnT VisitMemberListBinding(MemberListBinding binding, ContextT ctx)
 {
     throw new Exception("Overloaded visitors should implement this method");
     //return this.VisitElementInitializerList(binding.Initializers, ctx);
 }
Пример #5
0
        protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding)
        {
            var initializers = VisitElementInitializerList(binding.Initializers);

            return(!Equals(initializers, binding.Initializers) ? Expression.ListBind(binding.Member, initializers) : binding);
        }
Пример #6
0
 private bool VisitMemberListBinding(MemberListBinding x, MemberListBinding y)
 {
     return(VisitLists <ElementInit>(x.Initializers, y.Initializers, new Func <ElementInit, ElementInit, bool>(this, this.Equals)));
 }
Пример #7
0
        public void UpdateDifferentReturnsDifferent()
        {
            MemberListBinding binding = Expression.ListBind(typeof(ListWrapper <int>).GetProperty(nameof(ListWrapper <int> .ListProperty)), Enumerable.Range(0, 3).Select(i => Expression.ElementInit(typeof(List <int>).GetMethod("Add"), Expression.Constant(i))));

            Assert.NotSame(binding, binding.Update(new[] { Expression.ElementInit(typeof(List <int>).GetMethod(nameof(List <int> .Add)), Expression.Constant(1)) }));
        }
Пример #8
0
 protected virtual bool AreEqualMemberListBinding(MemberListBinding x, MemberListBinding y)
 {
     return(this.AreEqualElementInitializerList(x.Initializers, y.Initializers));
 }
Пример #9
0
 protected override MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     return(base.VisitMemberListBinding(node));
 }
Пример #10
0
 protected override MemberListBinding VisitMemberListBinding(MemberListBinding binding) => throw new ApplicationException();
 internal virtual bool VisitMemberListBinding(MemberListBinding binding, MemberListBinding other)
 {
     return(this.VisitElementInitializerList(binding.Initializers, other.Initializers) && binding.Member.Equals(other.Member));
 }
Пример #12
0
 /// <summary>
 /// Visit a <see cref="MemberListBinding"/>.
 /// </summary>
 /// <param name="memberListBinding"><see cref="MemberListBinding"/> to visit.</param>
 /// <returns>Returns the result of the visit.</returns>
 protected abstract object VisitMemberListBinding(MemberListBinding memberListBinding);
Пример #13
0
        private static MemberListBinding EnsureMemberListBinding(MemberListBinding binding)
        {
            var initializers = EnsureElementInitializerList(binding.Initializers);

            return(initializers != binding.Initializers ? Expression.ListBind(binding.Member, initializers) : binding);
        }
Пример #14
0
 private int VisitMemberListBinding(MemberListBinding binding)
 {
     return(this.VisitList(binding.Initializers));
 }
 protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding)
 {
     IEnumerable<ElementInit> initializers = this.VisitElementInitializerList(binding.Initializers);
     return this.UpdateMemberListBinding(binding, binding.Member, initializers);
 }
Пример #16
0
 /// <summary>
 /// Visits the children of <see cref="System.Linq.Expressions.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 override MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     throw new NotSupportedException($"Node type {node.GetType().Name} is not supported.");
 }
Пример #17
0
            internal ListBindingRewriter(MemberListBinding binding, StackSpiller spiller, Stack stack) :
                base(binding, spiller)
            {
                _inits = binding.Initializers;

                _childRewriters = new ChildRewriter[_inits.Count];
                for (int i = 0; i < _inits.Count; i++)
                {
                    ElementInit init = _inits[i];

                    ChildRewriter cr = new ChildRewriter(spiller, stack, init.Arguments.Count);
                    cr.Add(init.Arguments);

                    _action |= cr.Action;
                    _childRewriters[i] = cr;
                }
            }
Пример #18
0
        protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding)
        {
            IEnumerable <ElementInit> initializers = this.VisitElementInitializerList(binding.Initializers);

            return(this.UpdateMemberListBinding(binding, binding.Member, initializers));
        }
Пример #19
0
 protected virtual bool CompareMemberListBinding(MemberListBinding a, MemberListBinding b)
 {
     return(a.Member == b.Member &&
            CompareElementInitList(a.Initializers, b.Initializers));
 }
Пример #20
0
 /// <summary>
 /// Converts a <see cref="MemberListBinding"/> to a
 /// <see cref="SerializableMemberListBinding"/>.
 /// </summary>
 /// <param name="memberListBinding"><see cref="MemberListBinding"/> to convert.</param>
 /// <returns>Returns the converted <see cref="SerializableMemberListBinding"/>.</returns>
 /// <seealso cref="ExpressionVisitor.VisitMemberListBinding"/>
 protected override object VisitMemberListBinding(MemberListBinding memberListBinding)
 {
     return(new SerializableMemberListBinding(memberListBinding, this));
 }
 /// <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();
 }
 protected override MemberListBinding VisitMemberListBinding(MemberListBinding node) => throw new NotSupportedException($"MemberListBinding in expressions are not supported. Cannot convert {node} to SQL");
Пример #23
0
 /// <summary>
 /// Visits the children of the <see cref="T:System.Linq.Expressions.MemberListBinding"/>.
 /// </summary>
 /// <returns>
 /// The modified expression, if it or any sub-Expression was modified; otherwise, returns the original
 ///     Expression.
 /// </returns>
 /// <param name="node">
 /// The expression to visit.
 /// </param>
 protected override MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     return(this.visitMemberListBinding?.Invoke(node) ?? base.VisitMemberListBinding(node));
 }
Пример #24
0
 private object GenerateXmlFromListBinding(MemberListBinding memberListBinding)
 {
     return(new XElement("MemberListBinding",
                         GenerateXmlFromProperty(memberListBinding.Member.GetType(), "Member", memberListBinding.Member),
                         GenerateXmlFromProperty(memberListBinding.Initializers.GetType(), "Initializers", memberListBinding.Initializers)));
 }
Пример #25
0
 protected virtual void VisitMemberListBinding(MemberListBinding binding)
 {
     VisitElementInitializerList(binding.Initializers);
 }
Пример #26
0
 private void ToStringMemberListBinding(MemberListBinding binding)
 {
     ToStringElementInitializerList(binding.Initializers);
     return;
 }
Пример #27
0
 protected override MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     return(GiveUp(node));
 }
Пример #28
0
 /// <summary>
 /// Creates a <see cref="MemberListBinding"/>.
 /// </summary>
 /// <param name="memberListBinding"><see cref="MemberListBinding"/> to visit.</param>
 /// <returns>Returns a <see cref="MemberListBinding"/>.</returns>
 /// <seealso cref="ExpressionVisitor.VisitMemberListBinding"/>
 protected override object VisitMemberListBinding(MemberListBinding memberListBinding)
 {
     return(Expression.ListBind(memberListBinding.Member, VisitObjectCollection <ElementInit>(memberListBinding.Initializers)));
 }
 /// <summary>
 /// Visits a MemberListBinding.
 /// </summary>
 /// <param name="node">The MemberListBinding.</param>
 /// <returns>The MemberListBinding.</returns>
 protected override MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     throw new NotImplementedException();
 }
Пример #30
0
 /// <summary>
 /// Visits the children of <see cref="System.Linq.Expressions.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 override MemberListBinding VisitMemberListBinding(MemberListBinding node)
 {
     throw new NotSupportedException(string.Format(Resources.EX_PROCESS_NODE_NOT_SUPPORT, node.GetType().Name));
 }
 protected MemberListBinding UpdateMemberListBinding(MemberListBinding binding, MemberInfo member, IEnumerable<ElementInit> initializers)
 {
     if (initializers != binding.Initializers || member != binding.Member)
     {
         return Expression.ListBind(member, initializers);
     }
     return binding;
 }
 private bool CompareMemberListBinding(MemberListBinding a, MemberListBinding b)
 => Equals(a.Member, b.Member) &&
 CompareElementInitList(a.Initializers, b.Initializers);
 protected virtual bool CompareMemberListBinding(MemberListBinding a, MemberListBinding b)
 {
     return a.Member == b.Member
         && this.CompareElementInitList(a.Initializers, b.Initializers);
 }
Пример #34
0
 private bool EqualsMemberListBinding(MemberListBinding x, MemberListBinding y)
 {
     return(Equals(x.Initializers, y.Initializers, this.EqualsElementInit));
 }
Пример #35
0
 private void EmitMemberListBinding(MemberListBinding binding)
 {
     Type type = GetMemberType(binding.Member);
     if (binding.Member is PropertyInfo && type.GetTypeInfo().IsValueType)
     {
         throw Error.CannotAutoInitializeValueTypeElementThroughProperty(binding.Member);
     }
     if (type.GetTypeInfo().IsValueType)
     {
         EmitMemberAddress(binding.Member, binding.Member.DeclaringType);
     }
     else
     {
         EmitMemberGet(binding.Member, binding.Member.DeclaringType);
     }
     EmitListInit(binding.Initializers, false, type);
 }
 protected virtual void PVisitMemberListBinding(MemberListBinding binding)
 {
 }