コード例 #1
0
 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);
 }
コード例 #2
0
 public static EditableBuilder <T> Require <T>(this EditableBuilder <T> builder, Permission requiredPermission) where T : AbstractEditableAttribute
 {
     builder.Configure(e => { e.RequiredPermission = requiredPermission; });
     return(builder);
 }
コード例 #3
0
 public static EditableBuilder <T> RequireRole <T>(this EditableBuilder <T> builder, params string[] anyOfTheseRoles) where T : AbstractEditableAttribute
 {
     builder.Configure(e => { e.AuthorizedRoles = anyOfTheseRoles; });
     return(builder);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 public static EditableBuilder <T> DefaultValue <T>(this EditableBuilder <T> builder, object value) where T : AbstractEditableAttribute
 {
     builder.Configure(e => e.DefaultValue = value);
     return(builder);
 }
コード例 #7
0
 /// <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);
 }
コード例 #8
0
 public static EditableBuilder <T> AllowedTemplates <T>(this EditableBuilder <T> builder, params string[] templateNames) where T : EditableChildrenAttribute
 {
     builder.Configure(eca => eca.AllowedTemplateKeys = templateNames);
     return(builder);
 }
コード例 #9
0
 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);
 }
コード例 #10
0
 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);
 }