Esempio n. 1
0
        public void Execute(IMemberElement element)
        {
            var attribute = new MemberBehaviorHelper<StringLengthAttribute>().GetAttribute(element);

            if(attribute != null && element is ISupportsMaxLength)
            {
                element.SetAttr(HtmlAttribute.MaxLength, attribute.MaximumLength);
            }
        }
 public void Execute(IMemberElement element)
 {
     var helper = new MemberBehaviorHelper<RequiredAttribute>();
     var attribute = helper.GetAttribute(element);
     if (attribute != null)
     {
         element.SetAttr("class", "req");
     }
 }
Esempio n. 3
0
        public void Execute(IMemberElement element)
        {
            var helper = new MemberBehaviorHelper <RequiredAttribute>();

            var attribute = helper.GetAttribute(element);

            if (attribute != null)
            {
                element.SetAttr(HtmlAttribute.Class, "required");
            }
        }
        public void Execute(IMemberElement element)
        {
            var helper = new MemberBehaviorHelper<RangeAttribute>();
            var attribute = helper.GetAttribute(element);

            if (attribute == null)
            {
                return;
            }

            if (element is ISupportsMaxLength)
            {
                element.SetAttr(HtmlAttribute.MaxLength, attribute.Maximum);
            }
        }
Esempio n. 5
0
        public void Execute(IMemberElement element)
        {
            var helper    = new MemberBehaviorHelper <StringLengthAttribute>();
            var attribute = helper.GetAttribute(element);

            if (attribute == null)
            {
                return;
            }

            if (element is ISupportsMaxLength)
            {
                element.SetAttr(HtmlAttribute.MaxLength, attribute.MaximumLength);
            }
        }