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); }
protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) { ReadOnlyCollection <MemberBinding> bindingExp = VisitBindingList(binding.Bindings); if (bindingExp != binding.Bindings) { return(Expression.MemberBind(binding.Member, bindingExp)); } return(binding); }
/// <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 = VisitBindingList(node.Bindings); if (bindings != node.Bindings) { return(Expression.MemberBind(node.Member, bindings)); } return(node); }
internal virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) { IEnumerable <MemberBinding> enumerable = this.VisitBindingList(binding.Bindings); if (enumerable != binding.Bindings) { return(Expression.MemberBind(binding.Member, enumerable)); } 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); }
private static MemberMemberBinding UpdateMemberMemberBinding( MemberMemberBinding node, MemberInfo member, IEnumerable <MemberBinding> bindings) { if (bindings != node.Bindings || member != node.Member) { return(Expression.MemberBind(member, bindings)); } return(node); }
/// <summary> /// Creates a new expression that is like this one, but using the /// supplied children. If all of the children are the same, it will /// return this expression. /// </summary> /// <param name="bindings">The <see cref="Bindings"/> property of the result.</param> /// <returns>This expression if no children changed, or an expression with the updated children.</returns> public MemberMemberBinding Update(IEnumerable <MemberBinding> bindings) { if (bindings != null) { if (ExpressionUtils.SameElements(ref bindings, Bindings)) { return(this); } } return(Expression.MemberBind(Member, bindings)); }
public void MemberInit_member_bind() { var expression = LinqExpression.MemberInit( LinqExpression.New( typeof(SampleClass)), LinqExpression.MemberBind( typeof(SampleClass).GetField(nameof(SampleClass.ComplexField)), LinqExpression.Bind( typeof(SampleClass).GetField(nameof(SampleClass.InstanceField)), LinqExpression.Constant( string.Empty)))); ShouldRoundrip(expression); }
protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) { var bindings = VisitBindingList(binding.Bindings); return(bindings != binding.Bindings ? Expression.MemberBind(binding.Member, bindings) : binding); }
/// <inheritdoc /> protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) => Expression.MemberBind(binding.Member, VisitBindingList(binding.Bindings));
/// <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); }
public static MemberMemberBinding MemberBind(MemberInfo member, MemberBinding[] bindings) => Expression.MemberBind(member, bindings); // NB: Used for fields. public static MemberMemberBinding MemberBind(MethodInfo propertyAccessor, MemberBinding[] bindings) => Expression.MemberBind(propertyAccessor, bindings); // NB: Used for properties.
public static MemberMemberBinding MemberBind(MemberInfo member, MemberBinding[] bindings) => Expression.MemberBind(member, bindings); // NB: Used for fields.
private MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) { var bindings = VisitBindingList(binding.Bindings); return(bindings != binding.Bindings ? Expression.MemberBind(binding.Member, bindings) : binding); }