/// <summary>
 /// Initializes a new instance of the <see cref="DefaultRenderContext"/> class.
 /// </summary>
 /// <param name="viewResolver"></param>
 /// <param name="viewCache"></param>
 /// <param name="textResource"></param>
 /// <param name="viewLocationContext"></param>
 public DefaultRenderContext(IViewResolver viewResolver, IViewCache viewCache, ITextResource textResource, ViewLocationContext viewLocationContext)
 {
     this.viewResolver        = viewResolver;
     this.viewCache           = viewCache;
     this.textResource        = textResource;
     this.viewLocationContext = viewLocationContext;
     this.textResourceFinder  = new TextResourceFinder(textResource, viewLocationContext.Context);
 }
Exemplo n.º 2
0
        public string Invoke(string content, dynamic model, IViewEngineHost host)
        {
            var Finder = new TextResourceFinder(resource,
                                                (NancyContext)host.Context);

            return(ResourceRegEx.Replace(
                       content,
                       m => {
                var key = m.Groups ["Key"].Value;
                return Finder [key];
            }));
        }