예제 #1
0
        public Renderer(Template template, IImageService imageService)
        {
            _template = template;
            _imageService = imageService;
            _compiler = new FormatCompiler();
            _compiler.RegisterTag(new ImgUrlTagDefinition(imageService), true);

            _generator = _compiler.Compile(_template.HTML);
        }
 private Template LoadTemplate()
 {
     var template = new Template();
     var fileLoaded = false;
     while (!fileLoaded)
     {
         try
         {
             template.LoadFile(TemplateFileName);
             fileLoaded = true;
         }
         catch (IOException)
         {
             Thread.Sleep(100);
         }
     }
     return template;
 }