Esempio n. 1
0
 internal void SetParent(PageLocation parentPage)
 {
     _parent = parentPage;
 }
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 4
0
 public static PageLocation GetRootPage()
 {
     PageLocation result = new PageLocation();
     result._isRoot = true;
     return result;
 }
Esempio n. 5
0
 public static PageLocation GetRootPage(PageLocation root)
 {
     root._isRoot = true;
     return root;
 }
Esempio n. 6
0
 protected void SetRoot(PageLocation root)
 {
     Root = root;
 }
Esempio n. 7
0
        protected void RecursePageLocations(PageLocation currentLocation)
        {
            if(currentLocation.HasChildren)
            {
                foreach(PageLocation childLocation in currentLocation.ChildLocations)
                {
                    childLocation.SetParent(currentLocation);
                    RecursePageLocations(childLocation);
                }
            }

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