Example #1
0
        public BbAttribute(string id,
                           string name,
                           Func <IAttributeRenderingContext, string> contentTransformer,
                           HtmlEncodingMode htmlEncodingMode)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

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

            Id = id;

            Name = name;

            ContentTransformer = contentTransformer;

            HtmlEncodingMode = htmlEncodingMode;
        }
        public BBAttribute(string id, string name, Func<IAttributeRenderingContext, string> contentTransformer, HtmlEncodingMode htmlEncodingMode)
        {
            if (id == null) throw new ArgumentNullException("id");
            if (name == null) throw new ArgumentNullException("name");
            if (!Enum.IsDefined(typeof(HtmlEncodingMode), htmlEncodingMode)) throw new ArgumentException("htmlEncodingMode");

            ID = id;
            Name = name;
            ContentTransformer = contentTransformer;
            HtmlEncodingMode = htmlEncodingMode;
        }
Example #3
0
        public BBAttribute(string id, string name, Func <IAttributeRenderingContext, string> contentTransformer, HtmlEncodingMode htmlEncodingMode)
        {
            if (!Enum.IsDefined(typeof(HtmlEncodingMode), htmlEncodingMode))
            {
                throw new ArgumentException("htmlEncodingMode");
            }

            ID   = id ?? throw new ArgumentNullException("id");
            Name = name ?? throw new ArgumentNullException("name");
            ContentTransformer = contentTransformer;
            HtmlEncodingMode   = htmlEncodingMode;
        }