Ejemplo n.º 1
0
        internal Level GetOrAddNextLevel4Member(HierarchyMember HierarchyMember)
        {
            int levelIndex;

            if (HierarchyMember == null)
            {
                levelIndex = 0;
            }
            else
            {
                levelIndex = HierarchyMember.Level.Index + 1;
            }

            Level result;

            if (Levels.Count <= levelIndex)
            {
                result = new Level(this, Levels.Count);
                Levels.Add(result);
            }
            else
            {
                result = Levels[levelIndex];
            }

            return(result);
        }
Ejemplo n.º 2
0
        public Tuple(Tuple ParentTuple, HierarchyMember Member)
        {
            this.ParentTuple = ParentTuple;
            if (ParentTuple != null)
            {
                this.hashCode = ParentTuple.GetHashCode();
            }

            this.Member    = Member;
            this.hashCode ^= Member.GetHashCode();
        }
Ejemplo n.º 3
0
        internal HierarchyMember(Hierarchy Hierarchy, HierarchyMember ParentMember, Level Level, string UniqueNameInHierarchy)
        {
            this.Hierarchy    = Hierarchy;
            this.UniqueName   = UniqueNameInHierarchy;
            this.Level        = Level;
            this.ParentMember = ParentMember;

            Hierarchy.Members[UniqueNameInHierarchy] = this;
            if (ParentMember == null)
            {
                Hierarchy.FirstLevelMembers.Add(this);
            }
            else
            {
                ParentMember.Childs.Add(this);
            }
        }
Ejemplo n.º 4
0
        public HierarchyMember GetOrAddMember(string UniqueNameInHierarchy)
        {
            HierarchyMember result = null;

            if (!Members.TryGetValue(UniqueNameInHierarchy, out result))
            {
                HierarchyMember ParentMember;

                if (ParentUniqueNameResolve != null)
                {
                    ParentMember = GetOrAddMember(ParentUniqueNameResolve(UniqueNameInHierarchy));
                }
                else
                {
                    ParentMember = null;
                }

                var Level = GetOrAddNextLevel4Member(ParentMember);
                result = new HierarchyMember(this, ParentMember, Level, UniqueNameInHierarchy);
            }
            return(result);
        }
		public Tuple(Tuple ParentTuple, HierarchyMember Member)
		{
			this.ParentTuple = ParentTuple;
			if (ParentTuple!=null)
				this.hashCode=ParentTuple.GetHashCode();
				
			this.Member = Member;
			this.hashCode^=Member.GetHashCode();
		}
		internal HierarchyMember(Hierarchy Hierarchy, HierarchyMember ParentMember, Level Level, string UniqueNameInHierarchy)
		{
			this.Hierarchy = Hierarchy;
			this.UniqueName = UniqueNameInHierarchy;
			this.Level = Level;
			this.ParentMember = ParentMember;
			
			Hierarchy.Members[UniqueNameInHierarchy] = this;
			if (ParentMember==null)
				Hierarchy.FirstLevelMembers.Add(this);
			else
				ParentMember.Childs.Add(this);
			
		}
		public HierarchyMember GetOrAddMember(string UniqueNameInHierarchy)
		{
			HierarchyMember result = null;
			if (!Members.TryGetValue(UniqueNameInHierarchy, out result))
			{
				HierarchyMember ParentMember;
				
				if (ParentUniqueNameResolve != null)
					ParentMember = GetOrAddMember(ParentUniqueNameResolve(UniqueNameInHierarchy));
				else
					ParentMember = null;

				var Level = GetOrAddNextLevel4Member(ParentMember);
				result = new HierarchyMember(this, ParentMember, Level, UniqueNameInHierarchy);
			}
			return result;
		}
		internal Level GetOrAddNextLevel4Member(HierarchyMember HierarchyMember)
		{
			int levelIndex;
			if(HierarchyMember==null)
				levelIndex=0;
			else
				levelIndex=HierarchyMember.Level.Index+1;
			
			Level result;
			if (Levels.Count <= levelIndex)
			{
				result = new Level(this,Levels.Count);
				Levels.Add(result);
			}	
			else
				result = Levels[levelIndex];
			
			return result;
		}