/// <summary> /// Retrieve all ancestors /// </summary> /// <param name="node">the node</param> /// <returns></returns> private void GetAncestors(SiteMapNodeModel node) { if (node.Parent != null) { ancestors.Add(node.Parent); GetAncestors(node.Parent); } }
/// <summary> /// Retrieve all descendants /// </summary> /// <param name="node">the node</param> /// <returns></returns> private void GetDescendants(SiteMapNodeModel node) { var sortedNodes = SortSiteMapNodes <SiteMapNodeModel>(node.Children); foreach (var child in sortedNodes) { descendants.Add(child); GetDescendants(child); } }