예제 #1
0
        internal static MemberBindingNode Create(NodeContext factory, MemberBinding memberBinding)
        {
            MemberBindingNode memberBindingNode = null;

            if (memberBinding is MemberAssignment)
                memberBindingNode = new MemberAssignmentNode(factory, (MemberAssignment)memberBinding);
            else if (memberBinding is MemberListBinding)
                memberBindingNode = new MemberListBindingNode(factory, (MemberListBinding)memberBinding);
            else if (memberBinding is MemberMemberBinding)
                memberBindingNode = new MemberMemberBindingNode(factory, (MemberMemberBinding)memberBinding);
            else if (memberBinding != null)
                throw new ArgumentException("Unknown member binding of type " + memberBinding.GetType(), "memberBinding");

            return memberBindingNode;
        }
 public MemberMemberBindingNode(NodeContext factory, MemberMemberBinding memberMemberBinding) : base(factory, memberMemberBinding.BindingType, memberMemberBinding.Member)
 {
     Bindings = new MemberBindingNodeList(factory, memberMemberBinding.Bindings);
 }
예제 #3
0
 protected MemberBindingNode(NodeContext factory, MemberBindingType bindingType, MemberInfo memberInfo) : base(factory)
 {
     BindingType = bindingType;
     Member = new MemberInfoNode(Context, memberInfo);
 }
 public MemberListBindingNode(NodeContext factory, MemberListBinding memberListBinding) : base(factory, memberListBinding.BindingType, memberListBinding.Member)
 {
     Initializers = new ElementInitNodeList(Context, memberListBinding.Initializers);
 }
예제 #5
0
 protected MemberBindingNode(NodeContext factory) : base(factory) { }
        private void AssertExpression(Expression expression, string message = null)
        {
            var factory = new NodeContext();
            var expressionNode = factory.Create(expression);
            var createdExpression = expressionNode.ToExpression();

            ExpressionAssert.AreEqual(expression, createdExpression, message);

            //PublicInstancePropertiesAssert.Equal(expression, createdExpression, message);
            //Assert.Equal(expression.ToString(), createdExpression.ToString(), message);

            // this.TestContext.WriteLine("'{0}' == '{1}'", expression.ToString(), createdExpression.ToString());
        }
예제 #7
0
 public ElementInitNode(NodeContext factory, ElementInit elementInit) : base(factory)
 {
     Initialize(elementInit);
 }
 public MemberAssignmentNode(NodeContext factory, MemberAssignment memberAssignment) : base(factory, memberAssignment.BindingType, memberAssignment.Member)
 {
     Expression = Context.Create(memberAssignment.Expression);
 }
예제 #9
0
 protected Node(NodeContext context)
 {
     if(context == null) throw new ArgumentNullException("context");
     Context = context;
 }
예제 #10
0
 public TypeNode(NodeContext factory, Type type) : base(factory)
 {
     Initialize(type);
 }