示例#1
0
        protected virtual string GetListBoxCssClass()
        {
            var builder = new CssClassBuilder();

            AppendListBoxCssClass(builder);
            builder.Append("listbox");
            return(builder.ToString());
        }
示例#2
0
        protected virtual string GetCheckBoxCssClass()
        {
            var builder = new CssClassBuilder();

            AppendCheckBoxCssClass(builder);
            builder.Append("checkbox");
            foreach (var cssClass in CssClasses)
            {
                builder.Append(cssClass);
            }
            return(builder.ToString());
        }
示例#3
0
文件: Field.cs 项目: formist/LinkMe
        protected string GetControlCssClass()
        {
            var builder = new CssClassBuilder();

            foreach (var cssPrefix in _cssPrefixes)
            {
                builder.Append(cssPrefix.EndsWith("_") ? cssPrefix + "control" : cssPrefix + "_control");
            }

            AppendControlCssClass(builder);
            builder.Append("control");
            return(builder.ToString());
        }
示例#4
0
        protected virtual string GetDropDownListCssClass()
        {
            var builder = new CssClassBuilder();

            foreach (var cssPrefix in CssPrefixes)
            {
                builder.Append(cssPrefix);
            }
            foreach (var classValue in CssClasses)
            {
                builder.Append(classValue);
            }
            return(builder.ToString());
        }
示例#5
0
        protected virtual string GetTextBoxCssClass()
        {
            var builder = new CssClassBuilder();

            foreach (var cssPrefix in CssPrefixes)
            {
                builder.Append(cssPrefix);
            }
            AppendTextBoxCssClass(builder);
            foreach (var cssClass in CssClasses)
            {
                builder.Append(cssClass);
            }
            return(builder.ToString());
        }
示例#6
0
        protected virtual void AppendTextBoxCssClass(CssClassBuilder builder)
        {
            switch (_width)
            {
            case TextBoxWidth.Shorter:
                builder.Append("shorter_textbox");
                break;

            case TextBoxWidth.Larger:
                builder.Append("wider_textbox");
                break;

            case TextBoxWidth.Largest:
                builder.Append("widest_textbox");
                break;
            }
        }
示例#7
0
        protected override void AppendControlCssClass(CssClassBuilder builder)
        {
            base.AppendControlCssClass(builder);

            // Add an error attribute if needed.

            if (string.IsNullOrEmpty(Name) || !Html.ViewData.ModelState.ContainsKey(Name))
            {
                return;
            }

            var modelState  = Html.ViewData.ModelState[Name];
            var modelErrors = modelState == null ? null : modelState.Errors;

            if (modelErrors != null && modelErrors.Count > 0)
            {
                builder.Append("error");
            }
        }
示例#8
0
文件: Field.cs 项目: formist/LinkMe
        protected string GetFieldCssClass()
        {
            var builder = new CssClassBuilder();

            foreach (var cssPrefix in _cssPrefixes)
            {
                builder.Append(cssPrefix.EndsWith("_") ? cssPrefix + "field" : cssPrefix + "_field");
            }

            // Add options.

            if (IsRequired)
            {
                builder.Append("compulsory_field");
            }
            if (IsReadOnly)
            {
                builder.Append("read-only_field");
            }

            AppendFieldCssClass(builder);
            builder.Append("field");
            return(builder.ToString());
        }
示例#9
0
 protected virtual void AppendListBoxCssClass(CssClassBuilder builder)
 {
 }
示例#10
0
文件: Field.cs 项目: formist/LinkMe
 protected virtual void AppendControlCssClass(CssClassBuilder builder)
 {
 }
示例#11
0
文件: Field.cs 项目: formist/LinkMe
 protected virtual void AppendFieldCssClass(CssClassBuilder builder)
 {
 }
示例#12
0
 protected virtual void AppendCheckBoxCssClass(CssClassBuilder builder)
 {
 }