Exemplo n.º 1
0
        // This method is only used by WebPageBase to allow passing in the view context and writer.
        public void ExecutePageHierarchy(
            WebPageContext pageContext,
            TextWriter writer,
            WebPageRenderingBase startPage
            )
        {
            PushContext(pageContext, writer);

            if (startPage != null)
            {
                if (startPage != this)
                {
                    var startPageContext = WebPageContext.CreateNestedPageContext <object>(
                        parentContext: pageContext,
                        pageData: null,
                        model: null,
                        isLayoutPage: false
                        );
                    startPageContext.Page = startPage;
                    startPage.PageContext = startPageContext;
                }
                startPage.ExecutePageHierarchy();
            }
            else
            {
                ExecutePageHierarchy();
            }
            PopContext();
        }
Exemplo n.º 2
0
 private bool PrepareStartPage(WebPageContext pageContext, WebPageRenderingBase startPage)
 {
     if (startPage != null && startPage != this)
     {
         var startPageContext = WebPageContext.CreateNestedPageContext <object>(parentContext: pageContext, pageData: null, model: null, isLayoutPage: false);
         startPageContext.Page = startPage;
         startPage.PageContext = startPageContext;
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
        private WebPageContext CreatePageContextFromParameters(bool isLayoutPage, params object[] data)
        {
            object first = null;

            if (data != null && data.Length > 0)
            {
                first = data[0];
            }

            var pageData = PageDataDictionary <dynamic> .CreatePageDataFromParameters(PageData, data);

            return(WebPageContext.CreateNestedPageContext(PageContext, pageData, first, isLayoutPage));
        }