protected override MemberListBinding VisitMemberListBinding(MemberListBinding binding) { Accumulate(binding.Member); return base.VisitMemberListBinding(binding); }
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)); }
public virtual ReturnT VisitMemberListBinding(MemberListBinding binding, ContextT ctx) { throw new Exception("Overloaded visitors should implement this method"); //return this.VisitElementInitializerList(binding.Initializers, ctx); }
protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding) { var initializers = VisitElementInitializerList(binding.Initializers); return(!Equals(initializers, binding.Initializers) ? Expression.ListBind(binding.Member, initializers) : binding); }
private bool VisitMemberListBinding(MemberListBinding x, MemberListBinding y) { return(VisitLists <ElementInit>(x.Initializers, y.Initializers, new Func <ElementInit, ElementInit, bool>(this, this.Equals))); }
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)) })); }
protected virtual bool AreEqualMemberListBinding(MemberListBinding x, MemberListBinding y) { return(this.AreEqualElementInitializerList(x.Initializers, y.Initializers)); }
protected override MemberListBinding VisitMemberListBinding(MemberListBinding node) { return(base.VisitMemberListBinding(node)); }
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)); }
/// <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);
private static MemberListBinding EnsureMemberListBinding(MemberListBinding binding) { var initializers = EnsureElementInitializerList(binding.Initializers); return(initializers != binding.Initializers ? Expression.ListBind(binding.Member, initializers) : binding); }
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); }
/// <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."); }
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; } }
protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding) { IEnumerable <ElementInit> initializers = this.VisitElementInitializerList(binding.Initializers); return(this.UpdateMemberListBinding(binding, binding.Member, initializers)); }
protected virtual bool CompareMemberListBinding(MemberListBinding a, MemberListBinding b) { return(a.Member == b.Member && CompareElementInitList(a.Initializers, b.Initializers)); }
/// <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");
/// <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)); }
private object GenerateXmlFromListBinding(MemberListBinding memberListBinding) { return(new XElement("MemberListBinding", GenerateXmlFromProperty(memberListBinding.Member.GetType(), "Member", memberListBinding.Member), GenerateXmlFromProperty(memberListBinding.Initializers.GetType(), "Initializers", memberListBinding.Initializers))); }
protected virtual void VisitMemberListBinding(MemberListBinding binding) { VisitElementInitializerList(binding.Initializers); }
private void ToStringMemberListBinding(MemberListBinding binding) { ToStringElementInitializerList(binding.Initializers); return; }
protected override MemberListBinding VisitMemberListBinding(MemberListBinding node) { return(GiveUp(node)); }
/// <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(); }
/// <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); }
private bool EqualsMemberListBinding(MemberListBinding x, MemberListBinding y) { return(Equals(x.Initializers, y.Initializers, this.EqualsElementInit)); }
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) { }