/// <summary> /// Constructor, creates an <see cref="OpenCloseTagDefinition"/> /// </summary> /// <param name="openTagRegex"> /// The <see cref="Regex"/> that is used to find <see cref="IOpenTagInstance"/>s /// </param> /// <param name="closeTagRegex"> /// The <see cref="Regex"/> that is used to find <see cref="ICloseTagInstance"/>s /// </param> /// <param name="closeTag">The BBCode close tag for this tag definition</param> /// <param name="openTagVetoRulesSet"> /// Collections of <see cref="IVetoRule"/>s that are used by the /// <see cref="IOpenTagInstance.CheckForVetoAgainstAnotherTag"/> and /// <see cref="IOpenTagInstance.CheckForSelfVeto"/> methods to determine tag validity. /// </param> /// <param name="closeTagVetoRules"> /// A collection of <see cref="IVetoRule"/>s that are used by the /// <see cref="ICloseTagInstance.CheckIfValidClose"/> method to determine tag validity. /// </param> /// <param name="rendersToInlineElement"> /// Whether or not the tags will render to a inline XHTML elements (such as a span tags) or not (such as /// blockquote tags). /// </param> protected OpenCloseTagDefinition(Regex openTagRegex, Regex closeTagRegex, string closeTag, OpenTagVetoRulesSet openTagVetoRulesSet, IEnumerable <IVetoRule> closeTagVetoRules, bool rendersToInlineElement) { _OpenTagRegex = openTagRegex; _CloseTagVetoRules = closeTagVetoRules; _CloseTagRegex = closeTagRegex; _CloseTag = closeTag; _OpenTagVetoRulesSet = openTagVetoRulesSet; _RendersToInlineElement = rendersToInlineElement; }
/// <summary> /// Constructor, creates a <see cref="OpenTagInstance"/> /// </summary> /// <param name="charRange">The range of characters that the tag falls under</param> /// <param name="parentDefinition"> /// The <see cref="ITagDefinition"/> that created this <see cref="ITagInstance"/> /// </param> /// <param name="rendersToInlineElement"> /// Whether or not the tag will render to an inline XHTML element (such as a span tag) or not (such as a /// blockquote tag). /// </param> /// <param name="openTagVetoRulesSet"> /// Collections of <see cref="IVetoRule"/>s that are used by the <see cref="CheckForVetoAgainstAnotherTag"/> /// and <see cref="CheckForSelfVeto"/> methods to determine tag validity. /// </param> /// <param name="attributes">Any attributes set on the tag (ie. tag metadata)</param> public OpenTagInstance(CharRange charRange, ITagDefinition parentDefinition, bool rendersToInlineElement, OpenTagVetoRulesSet openTagVetoRulesSet, IEnumerable <KeyValuePair <string, object> > attributes) : base(charRange, parentDefinition, rendersToInlineElement, attributes) { _OpenTagVetoRulesSet = openTagVetoRulesSet; }
/// <summary> /// Constructor, creates a <see cref="SimpleTagDefinition"/> /// </summary> /// <param name="openTagRegex"> /// The <see cref="Regex"/> that is used to find <see cref="IOpenTagInstance"/>s /// </param> /// <param name="replacementOpenTagFactory"> /// A function that takes an <see cref="IOpenTagInstance"/> and creates some XHTML which is returned /// and replaced in place of the <see cref="IOpenTagInstance"/> in the render string. /// </param> /// <param name="closeTagRegex"> /// The <see cref="Regex"/> that is used to find <see cref="ICloseTagInstance"/>s /// </param> /// <param name="replacementCloseTagFactory"> /// A function that takes an <see cref="ICloseTagInstance"/> and creates some XHTML which is returned /// and replaced in place of the <see cref="ICloseTagInstance"/> in the render string. /// </param> /// <param name="closeTag">The BBCode close tag for this tag definition</param> /// <param name="openTagVetoRulesSet"> /// Collections of <see cref="IVetoRule"/>s that are used by the /// <see cref="IOpenTagInstance.CheckForVetoAgainstAnotherTag"/> and /// <see cref="IOpenTagInstance.CheckForSelfVeto"/> methods to determine tag validity. /// </param> /// <param name="closeTagVetoRules"> /// A collection of <see cref="IVetoRule"/>s that are used by the /// <see cref="ICloseTagInstance.CheckIfValidClose"/> method to determine tag validity. /// </param> /// <param name="rendersToInlineElement"> /// Whether or not the tags will render to a inline XHTML elements (such as a span tags) or not (such as /// blockquote tags). /// </param> /// <param name="cacheableRender"> /// True if the results of using <paramref name="replacementOpenTagFactory"/> and /// <paramref name="replacementCloseTagFactory"/> result in a cacheable render, false otherwise. For more /// information about cacheable renders, see <see cref="RenderContext.IsCacheable"/>. /// </param> public SimpleTagDefinition(Regex openTagRegex, Func <IOpenTagInstance, string> replacementOpenTagFactory, Regex closeTagRegex, Func <ICloseTagInstance, string> replacementCloseTagFactory, string closeTag, OpenTagVetoRulesSet openTagVetoRulesSet, IEnumerable <IVetoRule> closeTagVetoRules, bool rendersToInlineElement, bool cacheableRender) : base(openTagRegex, closeTagRegex, closeTag, openTagVetoRulesSet, closeTagVetoRules, rendersToInlineElement) { _ReplacementOpenTagFactory = replacementOpenTagFactory; _ReplacementCloseTagFactory = replacementCloseTagFactory; _CacheableRender = cacheableRender; }