public static ValidationSugarOptionItemModel Add(this ValidationSugarOptionItemModel thisValue, ValidationSugar.OptionItemType type, string tip)
 {
     if (thisValue.ItemOption.TypeParams == null)
     {
         thisValue.ItemOption.TypeParams = new List <ValidationSugar.OptionItemTypeParams>();
     }
     ValidationSugar.OptionItemTypeParams par = new ValidationSugar.OptionItemTypeParams()
     {
         Type = type,
         Tip  = tip
     };
     thisValue.ItemOption.TypeParams.Add(par);
     return(thisValue);
 }
        public static ValidationSugarOptionItemModel Set(this InitScriptModel thisValue, string formFiledName, bool isRequired, string placeholder = "", bool isMultiselect = false)
        {
            ValidationSugarOptionItemModel item = new ValidationSugarOptionItemModel();

            item.ItemOption = new ValidationSugar.OptionItem()
            {
                FormFiledName = formFiledName,
                IsMultiselect = isMultiselect,
                Placeholder   = placeholder,
                IsRequired    = isRequired
            };
            thisValue = null;
            return(item);
        }
 public static ValidationSugarOptionItemModel AddFunc(this ValidationSugarOptionItemModel thisValue, string func, string tip)
 {
     if (thisValue.ItemOption.TypeParams == null)
     {
         thisValue.ItemOption.TypeParams = new List <ValidationSugar.OptionItemTypeParams>();
     }
     ValidationSugar.OptionItemTypeParams par = new ValidationSugar.OptionItemTypeParams()
     {
         Func = func,
         Tip  = tip,
         Type = ValidationSugar.OptionItemType.Func
     };
     thisValue.ItemOption.TypeParams.Add(par);
     return(thisValue);
 }
 public static ValidationSugarOptionItemModel AddRegex(this ValidationSugarOptionItemModel thisValue, string pattern, string tip)
 {
     if (thisValue.ItemOption.TypeParams == null)
     {
         thisValue.ItemOption.TypeParams = new List <ValidationSugar.OptionItemTypeParams>();
     }
     ValidationSugar.OptionItemTypeParams par = new ValidationSugar.OptionItemTypeParams()
     {
         Pattern = pattern,
         Tip     = tip,
         Type    = ValidationSugar.OptionItemType.Regex
     };
     thisValue.ItemOption.TypeParams.Add(par);
     return(thisValue);
 }
 public static ValidationSugar.OptionItem ToOptionItem(this ValidationSugarOptionItemModel thisValue)
 {
     return(thisValue.ItemOption);
 }