public VelocityTemplateEngine(PipelineContext context, Configuration.Template template, IReader templateReader)
        {
            VelocityInitializer.Init();

            _context        = context;
            _template       = template;
            _templateReader = templateReader;
        }
Example #2
0
        public RazorTemplateEngine(IContext context, Configuration.Template template, IReader templateReader)
        {
            _context        = context;
            _template       = template;
            _templateReader = templateReader;

            _engine = new RazorEngine();
        }
 public RazorTemplateEngine(PipelineContext context, Configuration.Template template, IReader templateReader) {
     _context = context;
     _template = template;
     _templateReader = templateReader;
     var config = new FluentTemplateServiceConfiguration(
         c => c.WithEncoding(_template.ContentType == "html" ? Encoding.Html : Encoding.Raw)
               .WithCodeLanguage(Language.CSharp)
     );
     _service = RazorEngineService.Create(config);
 }
Example #4
0
 public OrchardRazorTemplateEngine(
     PipelineContext context,
     ITemplateProcessor templateProcessor,
     Configuration.Template template,
     IReader templateReader)
 {
     _context           = context;
     _templateProcessor = templateProcessor;
     _template          = template;
     _templateReader    = templateReader;
 }
Example #5
0
        public RazorTemplateEngine(PipelineContext context, Configuration.Template template, IReader templateReader)
        {
            _context        = context;
            _template       = template;
            _templateReader = templateReader;
            var config = new FluentTemplateServiceConfiguration(
                c => c.WithEncoding(_template.ContentType == "html" ? Encoding.Html : Encoding.Raw)
                .WithCodeLanguage(Language.CSharp)
                );

            _service = RazorEngineService.Create(config);
        }
        public RazorTemplateEngine(PipelineContext context, Configuration.Template template, IReader templateReader)
        {
            _context        = context;
            _template       = template;
            _templateReader = templateReader;

            var config = new TemplateServiceConfiguration {
                EncodedStringFactory = _template.ContentType == "html" ? (IEncodedStringFactory) new HtmlEncodedStringFactory() : new RawStringFactory(),
                Language             = Language.CSharp,
                CachingProvider      = new DefaultCachingProvider(t => { })
            };

            _service = RazorEngineService.Create(config);
        }