Ejemplo n.º 1
0
        //
        private void RegisterViewEngine()
        {
            var lexer = new SimpleLexer();
              var parser = new SimpleParser(ParsingRules.Create);
              var engine = new Engine(templateName => Parse(lexer, parser, Context.Server.MapPath(templateName)));

              ViewEngines.Engines.Add(new SimpleEngine(engine, lexer, parser));
        }
Ejemplo n.º 2
0
        public SimpleEngine(Engine engine, Lexer lexer, Parser parser)
        {
            this.engine = engine;
              this.lexer = lexer;
              this.parser = parser;

              ViewLocationFormats = new[] {"~/Views/{1}/{0}.simple", "~/Views/Shared/{0}.simple"};
              PartialViewLocationFormats = new[] {"~/Views/{1}/{0}.simple", "~/Views/Shared/{0}.simple"};
        }
Ejemplo n.º 3
0
 public void SetUp()
 {
     lexer = new SimpleLexer();
       parser = new SimpleParser(ParsingRules.Create);
       templates = new Dictionary<string, string>();
       engine = new Engine(s => Parse(templates[s]));
       model = new ExpandoObject();
 }
Ejemplo n.º 4
0
 public SimpleView(Engine engine, IEnumerable<Node> nodes)
 {
     this.engine = engine;
       this.nodes = nodes;
 }