示例#1
0
        public static string GetFormGroupClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "control-group";
            }

            return "form-group";
        }
示例#2
0
        public static string GetFormGroupWarningClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "warning";
            }

            return "has-warning";
        }
示例#3
0
        public static string GetFormGroupSuccessClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "success";
            }

            return "has-success";
        }
示例#4
0
        public static string GetFormGroupInfoClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "info";
            }

            return "has-info";
        }
示例#5
0
        public static string GetFormGroupErrorClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "error";
            }

            return "has-error";
        }
示例#6
0
        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;
        }