MemberJoinTreeNode.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Structures / MemberJoinTreeNode.cs / 1 / MemberJoinTreeNode.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner [....]
// @backupOwner [....] 
//--------------------------------------------------------------------- 

using System.Data.Metadata.Edm; 
using System.Collections.Generic;
using System.Data.Common.Utils;

namespace System.Data.Mapping.ViewGeneration.Structures { 

    // A JoinTreeNode that represents a member in an association set or an entity set 
    internal class MemberJoinTreeNode : JoinTreeNode { 

        #region Constructors 
        // effects: Creates a join tree node for "value" and no children (the
        // node is optional depending on isOptional)
        internal MemberJoinTreeNode(EdmMember value, bool isOptional, IEnumerable children, MetadataWorkspace workspace) :
            base(isOptional, children, workspace) { 
            m_member = value;
        } 
        #endregion 

        #region Fields 
        private EdmMember m_member;
        #endregion

        #region Properties 
        internal override EdmType NodeType {
            get { return m_member.TypeUsage.EdmType;} 
        } 

        internal EdmMember Member { 
            get { return m_member; }
        }

        protected override string ContextName { 
            get { return m_member.Name;}
        } 
        #endregion 

        #region Methods 
        // effects: Determines all the identifiers used in this and adds them to identifiers
        internal override void GetIdentifiers(CqlIdentifiers identifiers) {
            identifiers.AddIdentifier(m_member.Name);
            identifiers.AddIdentifier(m_member.TypeUsage.EdmType.Name); 
        }
 
        protected override bool IsSameContext(JoinTreeNode second) { 
            MemberJoinTreeNode memberNode = second as MemberJoinTreeNode;
            return memberNode != null && Member.Equals(memberNode.Member); 
        }

        protected override JoinTreeNode CreateNodeFromContext(bool nodeIsOptional,
                                                              List children) { 
            return new MemberJoinTreeNode(m_member, nodeIsOptional, children, this.MetadataWorkspace);
        } 
        #endregion 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner [....]
// @backupOwner [....] 
//--------------------------------------------------------------------- 

using System.Data.Metadata.Edm; 
using System.Collections.Generic;
using System.Data.Common.Utils;

namespace System.Data.Mapping.ViewGeneration.Structures { 

    // A JoinTreeNode that represents a member in an association set or an entity set 
    internal class MemberJoinTreeNode : JoinTreeNode { 

        #region Constructors 
        // effects: Creates a join tree node for "value" and no children (the
        // node is optional depending on isOptional)
        internal MemberJoinTreeNode(EdmMember value, bool isOptional, IEnumerable children, MetadataWorkspace workspace) :
            base(isOptional, children, workspace) { 
            m_member = value;
        } 
        #endregion 

        #region Fields 
        private EdmMember m_member;
        #endregion

        #region Properties 
        internal override EdmType NodeType {
            get { return m_member.TypeUsage.EdmType;} 
        } 

        internal EdmMember Member { 
            get { return m_member; }
        }

        protected override string ContextName { 
            get { return m_member.Name;}
        } 
        #endregion 

        #region Methods 
        // effects: Determines all the identifiers used in this and adds them to identifiers
        internal override void GetIdentifiers(CqlIdentifiers identifiers) {
            identifiers.AddIdentifier(m_member.Name);
            identifiers.AddIdentifier(m_member.TypeUsage.EdmType.Name); 
        }
 
        protected override bool IsSameContext(JoinTreeNode second) { 
            MemberJoinTreeNode memberNode = second as MemberJoinTreeNode;
            return memberNode != null && Member.Equals(memberNode.Member); 
        }

        protected override JoinTreeNode CreateNodeFromContext(bool nodeIsOptional,
                                                              List children) { 
            return new MemberJoinTreeNode(m_member, nodeIsOptional, children, this.MetadataWorkspace);
        } 
        #endregion 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK