Example #1
0
        void RenderViewImpl(ViewContext viewContext, Func <XcstTemplateEvaluator, XcstOutputter> getOutputter, object instance)
        {
            if (viewContext is null)
            {
                throw new ArgumentNullException(nameof(viewContext));
            }
            if (instance is null)
            {
                throw new ArgumentNullException(nameof(instance));
            }

            XcstViewPage viewPage = instance as XcstViewPage
                                    ?? throw new InvalidOperationException($"The view at '{ViewPath}' must derive from {nameof(XcstViewPage)}, or {nameof(XcstViewPage)}<TModel>.");

            viewPage.ViewContext = viewContext;

            AddFileDependencies(instance, viewContext.HttpContext.Response);

            XcstEvaluator evaluator = XcstEvaluator.Using((object)viewPage);

            foreach (var item in viewContext.ViewData)
            {
                evaluator.WithParam(item.Key, item.Value);
            }

            getOutputter(evaluator.CallInitialTemplate())
            .Run();
        }
Example #2
0
 RenderViewPage(XcstViewPage page, HttpContext context) =>
 base.RenderPage(page, context);
Example #3
0
 XcstViewPageHandler(XcstViewPage page)
     : base(page)
 {
     _page = page;
 }
Example #4
0
 protected virtual void RenderViewPage(XcstViewPage page, HttpContextBase context) =>
 base.RenderPage(page, context);