Exemple #1
0
 internal void SetParent(PageLocation parentPage)
 {
     _parent = parentPage;
 }
Exemple #2
0
        public void AppendChild(PageLocation newChild)
        {
            // TODO: Q? test != self or not?

            newChild.SetParent(this);

            if (SiteMap.Instance.ContainsID(newChild.ID))
            {
                SiteMap.Instance[newChild.ID] = newChild;
            }
            else
                SiteMap.Instance.AddPage(newChild);

            _childLocations.Add(newChild);
        }
Exemple #3
0
        public PageLocation[] GetAncestors(bool includeSelf)
        {
            ArrayList ancestors = new ArrayList();

            if (includeSelf) ancestors.Add(this);

            PageLocation currentAncestor = _parent;
            while (null != currentAncestor)
            {
                ancestors.Add(currentAncestor);
                if (currentAncestor.IsRoot) break;
                currentAncestor = currentAncestor.Parent;
            }

            PageLocation[] results = new PageLocation[ancestors.Count];
            ancestors.CopyTo(results);
            return results;
        }
Exemple #4
0
 public static PageLocation GetRootPage()
 {
     PageLocation result = new PageLocation();
     result._isRoot = true;
     return result;
 }
Exemple #5
0
 public static PageLocation GetRootPage(PageLocation root)
 {
     root._isRoot = true;
     return root;
 }
Exemple #6
0
 protected void SetRoot(PageLocation root)
 {
     Root = root;
 }
Exemple #7
0
        protected void RecursePageLocations(PageLocation currentLocation)
        {
            if(currentLocation.HasChildren)
            {
                foreach(PageLocation childLocation in currentLocation.ChildLocations)
                {
                    childLocation.SetParent(currentLocation);
                    RecursePageLocations(childLocation);
                }
            }

            AddPage(currentLocation);
        }
Exemple #8
0
 public void AddPage(PageLocation value)
 {
     _pages.Add(value.ID, value);
 }
Exemple #9
0
 internal void SetParent(PageLocation parentPage)
 {
     _parent = parentPage;
 }
Exemple #10
0
 public static PageLocation GetRootPage(PageLocation root)
 {
     root._isRoot = true;
     return(root);
 }