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); }
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); }
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()); }
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); }
protected Node(NodeContext context) { if(context == null) throw new ArgumentNullException("context"); Context = context; }
public TypeNode(NodeContext factory, Type type) : base(factory) { Initialize(type); }