public PageRequestHandler(ControllerContext controllerContext, PageRequestFlowAdapter pageRequestFlowAdapter, SiteMappedContext siteMappedContext, PageMappedContext pageMappedContext)
        {
            Contract.Requires(siteMappedContext != null);
            Contract.Requires(pageRequestFlowAdapter != null);

            this._controllerContext      = controllerContext;
            this._siteMappedContext      = siteMappedContext;
            this._pageRequestFlowAdapter = pageRequestFlowAdapter;
            this._pageMappedContext      = pageMappedContext;
        }
Example #2
0
        /// <summary>
        /// 创建Page_Context
        /// </summary>
        /// <param name="controllerContext"></param>
        /// <param name="site"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public Page_Context CreatePageContext(ControllerContext controllerContext, SiteMappedContext siteMappedContext, PageMappedContext mappedContext)
        {
            Contract.Requires(controllerContext != null);
            Contract.Requires(siteMappedContext != null);
            Contract.Requires(mappedContext != null);

            foreach (var item in _events)
            {
                item.PreCreatePageContext(this, new PreCreatePageContextEventArgs(controllerContext, siteMappedContext, mappedContext));
            }
            var page_context = _pageRequestFlow.CreatePageContext(controllerContext, siteMappedContext, mappedContext);

            foreach (var item in _events)
            {
                var args = new PostCreatePageContextEventArgs(page_context);
                item.PostCreatePageContext(this, args);
                page_context = args.Page_Context;
            }

            return(page_context);
        }