コード例 #1
0
        /// <summary>
        /// Indictes where to render a template section in the page template.
        /// </summary>
        /// <param name="sectionName">The name of the page template section. This must be unique in a page template.</param>
        /// <returns>PageTemplateSectionTagOutput to allow for method chaining.</returns>
        public IPageTemplateSectionTagBuilder Section(string sectionName)
        {
            var factory = IckyDependencyResolution.ResolveFromMvcContext <IPageTemplateSectionTagBuilderFactory>();
            var output  = factory.Create(HtmlHelper, Model, sectionName);

            return(output);
        }
コード例 #2
0
        /// <summary>
        /// Indictes where to render a section in a custom entity details page template.
        /// </summary>
        /// <typeparam name="TModel">Custom entity display model type.</typeparam>
        /// <param name="helper">IPageTemplateHelper to extend.</param>
        /// <param name="sectionName">The name of the section. This must be unique in a page template.</param>
        /// <returns>ICustomEntityTemplateSectionTagBuilder to allow for method chaining.</returns>
        public static ICustomEntityTemplateSectionTagBuilder <TModel> CustomEntitySection <TModel>(
            this IPageTemplateHelper <ICustomEntityDetailsPageViewModel <TModel> > helper, string sectionName)
            where TModel : ICustomEntityDetailsDisplayViewModel
        {
            var factory = IckyDependencyResolution.ResolveFromMvcContext <ICustomEntityTemplateSectionTagBuilderFactory>();
            var output  = factory.Create(helper.HtmlHelper, helper.Model, sectionName);

            return(output);
        }
コード例 #3
0
 public CofoundryPageHelper(HtmlHelper htmlHelper)
 {
     // DI because mvc framework doesn't support injection yet
     Routing     = IckyDependencyResolution.ResolveFromMvcContext <IContentRouteLibrary>();
     Settings    = IckyDependencyResolution.ResolveFromMvcContext <ISettingsViewHelper>();
     CurrentUser = IckyDependencyResolution.ResolveFromMvcContext <ICurrentUserViewHelper>();
     Js          = IckyDependencyResolution.ResolveFromMvcContext <IJavascriptViewHelper>();;
     Sanitizer   = IckyDependencyResolution.ResolveFromMvcContext <IHtmlSanitizerHelper>();;
     Html        = IckyDependencyResolution.ResolveFromMvcContext <ICofoundryHtmlHelper>();;
     UI          = new UIViewHelper(htmlHelper);
 }
コード例 #4
0
        public override void OnResultExecuted(ResultExecutedContext filterContext)
        {
            // No constructor injection available on filters
            var optimizationSettings = IckyDependencyResolution.ResolveFromMvcContext <OptimizationSettings>();

            if (optimizationSettings.RemoveWhitespaceFromHtml)
            {
                // Only remove white space for HTML documents
                var response = filterContext.HttpContext.Response;
                if (response.ContentType == "text/html" && response.Filter != null && !filterContext.IsChildAction)
                {
                    response.Filter = new WhitespaceStream(response.Filter);
                }
            }
        }
コード例 #5
0
        private void LogException(Exception ex)
        {
            var errorLogginService = IckyDependencyResolution.ResolveFromMvcContext <IErrorLoggingService>();

            errorLogginService.Log(ex);
        }