Example #1
0
        private void GetSite(IPage rootPage, ref List <string> siteList)
        {
            if (rootPage == null || siteList.Count() > 200)
            {
                return;
            }

            //Add the current root
            siteList.Add(rootPage.Id);

            var pageCount = 9999999;


            //for each child of the root
            foreach (var child in rootPage.Children(out pageCount))
            {
                if (child.ChildrenCount() > 0)
                {
                    GetSite(child, ref siteList);
                }
                else
                {
                    siteList.Add(child.Id);
                }
            }
        }
Example #2
0
        private void GetSite(IPage rootPage, ref List <IPage> siteList)
        {
            //Add the current root
            siteList.Add(rootPage);

            var pageCount = 9999999;

            //for each child of the root
            foreach (var child in rootPage.Children(out pageCount))
            {
                if (child.ChildrenCount() > 0)
                {
                    EventLog.WriteEntry("recursing", "again");
                    GetSite(child, ref siteList);
                }
                else
                {
                    siteList.Add(child);
                }
            }
        }
        private void GetSite(IPage rootPage, ref List<IPage> siteList)
        {
            //Add the current root
            siteList.Add(rootPage);

            var pageCount = 9999999;

            //for each child of the root
            foreach (var child in rootPage.Children(out pageCount))
            {
                if (child.ChildrenCount() > 0)
                {
                    EventLog.WriteEntry("recursing", "again");
                    GetSite(child, ref siteList);
                }
                else
                {
                    siteList.Add(child);
                }
            }
        }
Example #4
0
 /// <summary>
 /// Returns navigation items for the provided <paramref name="node"/>.
 /// </summary>
 /// <typeparam name="T">Type of the navigation items to return.</typeparam>
 /// <param name="node">The navigation node.</param>
 /// <returns>Navigation items for the provided <paramref name="node"/>.</returns>
 public static IEnumerable <T> GetNavigationItems <T>(this IPage node) where T : class, IPage
 => node.Children <T>(c => !c.UmbracoNaviHide);
        private void GetSite(IPage rootPage, ref List<string> siteList)
        {
            if (rootPage == null || siteList.Count() > 200)
            {
                return;
            }

            //Add the current root
            siteList.Add(rootPage.Id);

            var pageCount = 9999999;


            //for each child of the root
            foreach (var child in rootPage.Children(out pageCount))
            {
                if (child.ChildrenCount() > 0)
                {
                    GetSite(child, ref siteList);
                }
                else
                {
                    siteList.Add(child.Id);
                }
            }
        }