Пример #1
0
        internal static MemberBindingNode Create(INodeFactory 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;
        }
Пример #2
0
        internal static MemberBindingNode Create(INodeFactory 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);
        }