public static EditableBuilder <T> Help <T>(this EditableBuilder <T> builder, string title, string text = null) where T : AbstractEditableAttribute { builder.Configure(e => { e.HelpTitle = title; e.HelpText = text; }); return(builder); }
public static EditableBuilder <T> Require <T>(this EditableBuilder <T> builder, Permission requiredPermission) where T : AbstractEditableAttribute { builder.Configure(e => { e.RequiredPermission = requiredPermission; }); return(builder); }
public static EditableBuilder <T> RequireRole <T>(this EditableBuilder <T> builder, params string[] anyOfTheseRoles) where T : AbstractEditableAttribute { builder.Configure(e => { e.AuthorizedRoles = anyOfTheseRoles; }); return(builder); }
public static EditableBuilder <T> Required <T>(this EditableBuilder <T> builder, string requiredMessage = null) where T : AbstractEditableAttribute { builder.Configure(e => { e.Required = true; e.RequiredMessage = requiredMessage; }); return(builder); }
public static EditableBuilder <T> Validation <T>(this EditableBuilder <T> builder, string validationExpression, string validationMessage = null, string validationText = null) where T : AbstractEditableAttribute { builder.Configure(e => { e.Validate = true; e.ValidationExpression = validationExpression; e.ValidationMessage = validationMessage; e.ValidationText = validationText; }); return(builder); }
public static EditableBuilder <T> DefaultValue <T>(this EditableBuilder <T> builder, object value) where T : AbstractEditableAttribute { builder.Configure(e => e.DefaultValue = value); return(builder); }
/// <summary>Adds a placeholder text to an editable.</summary> public static EditableBuilder <TEditable> Placeholder <TEditable>(this EditableBuilder <TEditable> editable, string placeholderText) where TEditable : AbstractEditableAttribute { editable.Configure(e => e.Placeholder = placeholderText); return(editable); }
public static EditableBuilder <T> AllowedTemplates <T>(this EditableBuilder <T> builder, params string[] templateNames) where T : EditableChildrenAttribute { builder.Configure(eca => eca.AllowedTemplateKeys = templateNames); return(builder); }
public static EditableBuilder <T> MultiLine <T>(this EditableBuilder <T> builder, int?rows = null) where T : EditableTextAttribute { builder = builder.Configure(e => e.TextMode = System.Web.UI.WebControls.TextBoxMode.MultiLine); builder = builder.Configure(e => e.Rows = rows ?? 0); return(builder); }
public static EditableBuilder <T> Mode <T>(this EditableBuilder <T> builder, System.Web.UI.WebControls.TextBoxMode mode) where T : EditableTextAttribute { builder.Configure(e => e.TextMode = mode); return(builder); }