/// <summary> /// 基本输入框 /// </summary> /// <returns></returns> public TextBoxDescriptor AsTextBox() { TextBoxDescriptor tag = new TextBoxDescriptor(_modelType, _key); tag.DataType = _dataType; _attributes[this._key] = tag; return(tag); }
public static TextBoxDescriptor AsProductSelector(this TagsHelper helper) { TextBoxDescriptor descriptor = helper.AsTextBox(); descriptor.AddClass(StringKeys.SelectProductClass); descriptor.AddProperty("data-width", "100%"); descriptor.AddProperty("data-url", Urls.SelectProduct); descriptor.SetTemplate("ProductSelector"); descriptor.ReadOnly(); return(descriptor); }
/// <summary> /// 基本输入框 /// </summary> /// <returns></returns> public TextBoxDescriptor AsTextBox() { TextBoxDescriptor tag = new TextBoxDescriptor(_modelType, _key); if (_attributes.ContainsKey(this._key)) { _attributes.Remove(this._key); } tag.DataType = _dataType; _attributes.Add(this._key, tag); return(tag); }
public static TextBoxDescriptor AsImageCaptcha(this TagsHelper tagsHelper) { TextBoxDescriptor textBoxDescriptor = tagsHelper.AsTextBox(); textBoxDescriptor.SetDisplayName("Captcha"); textBoxDescriptor.PlaceHolder("Captcha"); textBoxDescriptor.Required(); textBoxDescriptor.SetTemplate("ImageCaptcha"); textBoxDescriptor.Validator.Add(new ImageCaptchaModelValidator(textBoxDescriptor.Name)); textBoxDescriptor.MaxLength(10); textBoxDescriptor.AddClass("image-captcha"); return(textBoxDescriptor); }
public MultipurposePopup(string MainText, string DesiredInput, bool Input) { InitializeComponent(); IsInput = Input; if (Input) { MainLabel.Text = MainText; TextBoxDescriptor.Text = DesiredInput; } else { TextBox1.Hide(); TextBoxDescriptor.Hide(); MainLabel.Text = MainText; } }
public static TextBoxDescriptor PageSelector(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.SelectPageClass).AddProperty("data-url", Urls.SelectPage)); }
public static TextBoxDescriptor InnerUrl(this TextBoxDescriptor descriptor) { return(descriptor.RegularExpression(@"^~\/([A-Za-z0-9_-]|\/)+$")); }
public static TextBoxDescriptor UrlPart(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.UrlPart).SetTemplate("UrlPart").RegularExpression(RegularExpression.LetterNumberOrLine)); }
public static TextBoxDescriptor FileSelector(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.SelectMediaClass).AddProperty("data-url", Urls.SelectMedia).AddProperty("placeholder", "选择文件")); }
public static TextBoxDescriptor MediaSelector(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.SelectImageClass).AddProperty("data-url", Urls.SelectMedia).AddProperty("placeholder", "可粘贴上传图片")); }
public static TextBoxDescriptor UrlPart(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.UrlPart).SetTemplate("UrlPart")); }