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

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