Example #1
0
        public BBTag(string name, string openTagTemplate, string closeTagTemplate, bool autoRenderContent, EBBTagClosingStyle tagClosingClosingStyle, Func <string, string> contentTransformer, bool enableIterationElementBehavior, params BBAttribute[] attributes)
        {
            name.ThrowIfNull(nameof(name));
            openTagTemplate.ThrowIfNull(nameof(openTagTemplate));
            closeTagTemplate.ThrowIfNull(nameof(closeTagTemplate), true);

            if (!Enum.IsDefined(typeof(EBBTagClosingStyle), tagClosingClosingStyle))
            {
                throw new ArgumentException(nameof(tagClosingClosingStyle));
            }

            Name                           = name;
            OpenTagTemplate                = openTagTemplate;
            CloseTagTemplate               = closeTagTemplate ?? string.Empty;
            AutoRenderContent              = autoRenderContent;
            TagClosingStyle                = tagClosingClosingStyle;
            ContentTransformer             = contentTransformer;
            EnableIterationElementBehavior = enableIterationElementBehavior;
            Attributes                     = attributes ?? new BBAttribute[0];
        }
Example #2
0
 public BBTag(string name, string openTagTemplate, string closeTagTemplate, bool autoRenderContent, EBBTagClosingStyle tagClosingClosingStyle, Func <string, string> contentTransformer, params BBAttribute[] attributes)
     : this(name, openTagTemplate, closeTagTemplate, autoRenderContent, tagClosingClosingStyle, contentTransformer, false, attributes)
 {
 }