internal void SetParent(PageLocation parentPage) { _parent = parentPage; }
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); }
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; }
public static PageLocation GetRootPage() { PageLocation result = new PageLocation(); result._isRoot = true; return result; }
public static PageLocation GetRootPage(PageLocation root) { root._isRoot = true; return root; }
protected void SetRoot(PageLocation root) { Root = root; }
protected void RecursePageLocations(PageLocation currentLocation) { if(currentLocation.HasChildren) { foreach(PageLocation childLocation in currentLocation.ChildLocations) { childLocation.SetParent(currentLocation); RecursePageLocations(childLocation); } } AddPage(currentLocation); }
public void AddPage(PageLocation value) { _pages.Add(value.ID, value); }
public static PageLocation GetRootPage(PageLocation root) { root._isRoot = true; return(root); }