using System; using System.Collections.Generic; namespace mustache { /// /// Defines a tag that cannot contain inner text. /// public abstract class InlineTagDefinition : TagDefinition { /// /// Initializes a new instance of an InlineTagDefinition. /// /// The name of the tag being defined. protected InlineTagDefinition(string tagName) : base(tagName) { } /// /// Initializes a new instance of an InlineTagDefinition. /// /// The name of the tag being defined. /// Specifies whether the tag is a built-in tag. internal InlineTagDefinition(string tagName, bool isBuiltin) : base(tagName, isBuiltin) { } /// /// Gets or sets whether the tag can have content. /// /// True if the tag can have a body; otherwise, false. protected override bool GetHasContent() { return false; } /// /// Generates the text for the tag. /// /// The format provider to use. /// The text to decorate. This will always be an empty string. /// The arguments passed to the tag. /// The generated text. public sealed override string Decorate(IFormatProvider provider, string innerText, Dictionary arguments) { return GetText(provider, arguments); } /// /// Gets the text of the inline tag. /// /// The format provider to use. /// The arguments passed to the tag. /// The generated text. protected abstract string GetText(IFormatProvider provider, Dictionary arguments); } }