//private static readonly ITemplateParser _templateParser = new ViciTemplateParser(); internal static Template CreateTemplate(string templateFile, string destinationPath, bool onlyBody) { if (WebAppContext.Offline) return new Template(templateFile,destinationPath, onlyBody); string key = "TPL: " + destinationPath + ";" + templateFile; Template template = (Template) WebAppContext.WebCache[key]; if (template != null) return template; lock (_templateCacheLock) { template = (Template) WebAppContext.WebCache[key]; if (template != null) return template; template = new Template(templateFile, destinationPath, onlyBody); WebAppContext.WebCache.Insert(key, template, new CacheDependency(templateFile), Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(30)); } return template; }
public TemplateParserContext(View view, Template template) : base(ParserContextBehavior.Falsy|ParserContextBehavior.ReturnNullWhenNullReference) { FormatProvider = WebAppConfig.FormatProvider; _template = template; _view = view; }
internal static Template CreateTemplate(Template callingTemplate, string templateName, bool onlyBody) { return CreateTemplate(templateName, callingTemplate._destinationPath, onlyBody); }
private TemplateParserContext(TemplateParserContext parentContext) : base(parentContext) { _template = parentContext.Template; _view = parentContext.View; }
public TemplateParserContext(TemplateParserContext parentContext, Template template) : base(parentContext) { _template = template; _view = parentContext.View; }