public static string GetFormGroupClass(BootstrapVersions? bsVersion) { switch (bsVersion) { case BootstrapVersions.V2: return "control-group"; } return "form-group"; }
public static string GetFormGroupWarningClass(BootstrapVersions? bsVersion) { switch (bsVersion) { case BootstrapVersions.V2: return "warning"; } return "has-warning"; }
public static string GetFormGroupSuccessClass(BootstrapVersions? bsVersion) { switch (bsVersion) { case BootstrapVersions.V2: return "success"; } return "has-success"; }
public static string GetFormGroupInfoClass(BootstrapVersions? bsVersion) { switch (bsVersion) { case BootstrapVersions.V2: return "info"; } return "has-info"; }
public static string GetFormGroupErrorClass(BootstrapVersions? bsVersion) { switch (bsVersion) { case BootstrapVersions.V2: return "error"; } return "has-error"; }
public static string GetCssClass(IBasilWebControl control, BootstrapVersions? bsVersion) { var feedback = control.HasFeedback ? " has-feedback" : string.Empty; var cssClass = BootstrapHelper.GetFormGroupClass(bsVersion); if (!control.IsValid) cssClass += string.Format(" {0}{1}", BootstrapHelper.GetFormGroupErrorClass(bsVersion), feedback); if (control.IsWarning) cssClass += string.Format(" {0}{1}", BootstrapHelper.GetFormGroupWarningClass(bsVersion), feedback); if (control.IsInfo) cssClass += string.Format(" {0}{1}", BootstrapHelper.GetFormGroupInfoClass(bsVersion), feedback); if (control.IsSuccess) cssClass += string.Format(" {0}{1}", BootstrapHelper.GetFormGroupSuccessClass(bsVersion), feedback); return cssClass; }