public TemplateFactoryCache(CommonViewNamespaces commonViewNamespaces, RazorEngineSettings razorEngineSettings, ITemplateCompiler templateCompiler, IRazorTemplateGenerator templateGenerator) { _commonViewNamespaces = commonViewNamespaces; _razorEngineSettings = razorEngineSettings; _templateCompiler = templateCompiler; _templateGenerator = templateGenerator; _cache = new Dictionary <string, Type>(); _lastModifiedCache = new Cache <string, long>(name => name.LastModified()); }
public TemplateFactoryCache(CommonViewNamespaces commonViewNamespaces, RazorEngineSettings razorEngineSettings, ITemplateCompiler templateCompiler, IRazorTemplateGenerator templateGenerator) { _commonViewNamespaces = commonViewNamespaces; _razorEngineSettings = razorEngineSettings; _templateCompiler = templateCompiler; _templateGenerator = templateGenerator; _cache = new Dictionary<string, Type>(); _lastModifiedCache = new Cache<string, long>(name => name.LastModified()); }
/// <summary> /// Configure the mediator object, based on the configuration element of the mediator. /// </summary> /// <param name="configuration">The MediatorElement configuration.</param> public void Initialize() { _logger = TemplatingLogger.GetLogger(this.GetType()); _config = RazorMediatorConfigurationSection.GetConfiguration(); _generator = new RazorTemplateGenerator(); foreach (NamespaceElement nameSpace in _config.Namespaces) { _namespaces.Add(nameSpace.Namespace); } foreach (AssemblyElement assembly in _config.Assemblies) { _assemblies.Add(assembly.Assembly); } }