Пример #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));
        }
Пример #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"};
        }
Пример #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();
 }
Пример #4
0
 public SimpleView(Engine engine, IEnumerable<Node> nodes)
 {
     this.engine = engine;
       this.nodes = nodes;
 }