private void CheckExpectedNoRenderConditions() { if (Template.ContentTypeStaticName != "" && Template.ContentDemoEntity == null && Sexy.ContentGroup.Content.All(e => e == null)) { PreRenderStatus = RenderStatusType.MissingData; AlternateRendering = ToolbarForEmptyTemplate; //var toolbar = ToolbarForEmptyTemplate; //throw new RenderingException(RenderStatusType.MissingData, "No demo item found ");// /*LocalizeString("NoDemoItem.Text")*/+ " " + toolbar); } }
public void Init(Template template, App app, ModuleInfo hostingModule, IDataSource dataSource, InstancePurposes instancePurposes, SxcInstance sexy) { var templatePath = VirtualPathUtility.Combine(Internal.TemplateManager.GetTemplatePathRoot(template.Location, app) + "/", template.Path); // Throw Exception if Template does not exist if (!File.Exists(HostingEnvironment.MapPath(templatePath))) { // todo: rendering exception throw new SexyContentException("The template file '" + templatePath + "' does not exist."); } Template = template; TemplatePath = templatePath; App = app; ModuleInfo = hostingModule; DataSource = dataSource; InstancePurposes = instancePurposes; Sexy = sexy; // check common errors CheckExpectedTemplateErrors(); // check access permissions - before initializing or running data-code in the template CheckTemplatePermissions(sexy.AppPortalSettings); // Run engine-internal init stuff Init(); // call engine internal feature to optionally change what data is actually used or prepared for search... CustomizeData(); // check if rendering is possible, or throw exceptions... CheckExpectedNoRenderConditions(); if (PreRenderStatus == RenderStatusType.Unknown) { PreRenderStatus = RenderStatusType.Ok; } }
public RenderingException(RenderStatusType renderStat, Exception innerException) : base("Rendering Message", innerException) { RenderStatus = renderStat; }
public RenderingException(RenderStatusType renderStat, string message) : base(message) { RenderStatus = renderStat; }