RunPage() статический приватный Метод

static private RunPage ( HttpContext context, string path, Page pageNode, Exception &exception ) : void
context System.Web.HttpContext
path string
pageNode Page
exception System.Exception
Результат void
Пример #1
0
        public static string[] RunPagesBackground(HttpContext context, out Exception[] exceptions)
        {
            var pages = GetAllPage();

            string[]         result        = new string[pages.Count];
            List <string>    pageList      = new List <string>();
            List <Exception> exceptionList = new List <Exception>();

            foreach (Node pageItem in pages.Nodes)
            {
                Exception exc = null;
                Page      p   = (Page)pageItem;
                if (p != null && p.HasTemporaryPortletInfo)
                {
                    Site site = p.Site;

                    if (site != null)
                    {
                        Page.RunPage(HttpContext.Current, p.Path, p, out exc);
                        pageList.Add(p.Path);

                        if (exc != null)
                        {
                            exceptionList.Add(exc);
                        }
                    }
                }
            }
            pageList.CopyTo(result, 0);
            exceptions = exceptionList.ToArray();
            return(result);
        }
Пример #2
0
        public static string[] RunPagesBackground(HttpContext context, out Exception[] exceptions)
        {
            List <string>    pageList      = new List <string>();
            List <Exception> exceptionList = new List <Exception>();
            var pagesNodes = ContentQuery.Query(ContentRepository.SafeQueries.TypeIs, QuerySettings.AdminSettings, typeof(Page).Name).Nodes;

            foreach (var pageItem in pagesNodes)
            {
                Page p = (Page)pageItem;
                if (p != null && p.HasTemporaryPortletInfo)
                {
                    Site site = p.Site;

                    if (site != null)
                    {
                        Page.RunPage(HttpContext.Current, p.Path, p, out var exc);
                        pageList.Add(p.Path);

                        if (exc != null)
                        {
                            exceptionList.Add(exc);
                        }
                    }
                }
            }
            exceptions = exceptionList.ToArray();
            return(pageList.ToArray());
        }