Пример #1
0
 public static Tag CreateInput(InputTypes type, PropertyInfo propertyInfo, object value = null)
 {
     if (propertyInfo.HasCustomAttributeOfType <TemplateAttribute>(out TemplateAttribute attribute))
     {
         InputProvider.CreateFromTemplate(attribute, value);
     }
     return(InputTag.OfType(type, value)
            .SetAttribute("name", propertyInfo.Name));
 }
        public override Tag CreateInput(PropertyInfo propertyInfo, object data = null)
        {
            if (propertyInfo.HasCustomAttributeOfType <TemplateAttribute>(out TemplateAttribute templateAttribute))
            {
                return(CreateFromTemplate(templateAttribute, data));
            }

            return(InputTag.OfType(InputTypes.Number, data));
        }
Пример #3
0
        public static InputTag OfType(string type, object value = null)
        {
            Args.ThrowIf(type == null, "type can't be null");
            InputTag input = new InputTag("input", new { type = type });

            if (value != null)
            {
                input.SetAttribute("value", value.ToString());
            }

            input.SelfClosing = true;
            return(input);
        }
Пример #4
0
 public static Tag CreateInput(string type, string name, object value = null)
 {
     return(InputTag.OfType(type, value)
            .SetAttribute("name", name));
 }
Пример #5
0
 public override Tag CreateInput(object data = null)
 {
     return(InputTag.OfType(InputTypes.Password).SetAttribute("name", PropertyName));
 }