// 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)); }
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"}; }
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(); }
public SimpleView(Engine engine, IEnumerable<Node> nodes) { this.engine = engine; this.nodes = nodes; }