RegisterTag() public method

Registers the given tag definition with the parser.
public RegisterTag ( Mustache.TagDefinition definition, bool isTopLevel ) : void
definition Mustache.TagDefinition The tag definition to register.
isTopLevel bool Specifies whether the tag is immediately in scope.
return void
Esempio n. 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);
        }
Esempio n. 2
0
 public static void ResigterCustomTags(this FormatCompiler compiler)
 {
     compiler.RegisterTag(new TemplateDefinition(), true);
     compiler.RegisterTag(new IsNullOrEmptyTagDefinition(), true);
     compiler.RegisterTag(new AnyTagDefinition(), true);
     compiler.RegisterTag(new CamelizeTagDefinition(), true);
     compiler.RegisterTag(new LowerTagDefinition(), true);
     compiler.RegisterTag(new UpperTagDefinition(), true);
     compiler.RegisterTag(new TabTagDefinition(), true);
     compiler.RegisterTag(new CommentTagDefinition(), true);
 }
 /// <summary>
 /// Registers the given tag definition with the parser.
 /// </summary>
 /// <param name="definition">The tag definition to register.</param>
 /// <param name="isTopLevel">Specifies whether the tag is immediately in scope.</param>
 public void RegisterTag(TagDefinition definition, bool isTopLevel)
 {
     compiler.RegisterTag(definition, isTopLevel);
 }