Пример #1
0
        public MemberInitNode(MemberInitExpression memberInitExpression, ConstantExpression[] constExpressions, ParameterExpression[] parameterExpressions)
        {
            if (memberInitExpression == null)
            {
                throw new ArgumentNullException("memberInitExpression");
            }
            if (constExpressions == null)
            {
                throw new ArgumentNullException("constExpressions");
            }
            if (parameterExpressions == null)
            {
                throw new ArgumentNullException("parameterExpressions");
            }

            this.memberInitExpression = memberInitExpression;

            this.newNode = new NewNode(memberInitExpression.NewExpression, constExpressions, parameterExpressions);
            this.memberAssignmentNode = memberInitExpression.Bindings.Any(b => b is MemberAssignment) ?
                                        new MemberAssignmentsNode(memberInitExpression.Bindings, constExpressions, parameterExpressions) :
                                        MemberAssignmentsNode.Empty;

            this.listBindingNode = memberInitExpression.Bindings.Any(b => b is MemberListBinding) ?
                                   new MemberListBindingsNode(memberInitExpression.Bindings, constExpressions, parameterExpressions) :
                                   MemberListBindingsNode.Empty;

            this.memberMemberBindingNode = memberInitExpression.Bindings.Any(b => b is MemberMemberBinding) ?
                                           new MemberMemberBindingsNode(memberInitExpression.Bindings, constExpressions, parameterExpressions) :
                                           MemberMemberBindingsNode.Empty;
        }
 public PreparedMemberBinding
 (
     MemberInfo member,
     MemberAssignmentsNode memberAssignments,
     MemberListBindingsNode memberListBindings,
     MemberMemberBindingsNode memberMemberBindings
 )
 {
     this.Member               = member;
     this.MemberAssignments    = memberAssignments;
     this.MemberListBindings   = memberListBindings;
     this.MemberMemberBindings = memberMemberBindings;
 }