コード例 #1
0
        public static string Detail(this Tk5FieldInfoEx field, IFieldValueProvider row, bool showHint, bool needId)
        {
            TkDebug.AssertArgumentNull(field, "field", null);

            HtmlAttributeBuilder builder = new HtmlAttributeBuilder();

            AddNormalAttribute(field, builder, field.NickName, needId, true);
            object fieldValue = row[field.NickName];

            builder.Add("data-value", fieldValue.ToString());
            HtmlAttribute classAttr = builder["class"];

            if (classAttr == null)
            {
                builder.Add("class", "detail-content");
            }
            else
            {
                classAttr.Value = HtmlCommonUtil.MergeClass(classAttr.Value, "detail-content");
            }
            string displayValue = DisplayUtil.GetDisplayString(field.ListDetail.DetailDisplay,
                                                               fieldValue, field, row);

            return(string.Format(ObjectUtil.SysCulture, "<div {0}>{1}</div>",
                                 builder.CreateAttribute(), displayValue));
        }
コード例 #2
0
        internal static string GetTotalClass(string @class, BootcssButton buttonType, bool block)
        {
            string buttonClass = BUTTON_ARRAY[(int)buttonType];
            string blockClass  = block ? "btn-block" : string.Empty;
            string totalClass  = HtmlCommonUtil.MergeClass("btn", buttonClass, blockClass, @class);

            return(totalClass);
        }
コード例 #3
0
        private static void AddNormalAttribute(Tk5FieldInfoEx field, HtmlAttributeBuilder builder,
                                               string name, bool needId, bool isHidden = false)
        {
            if (needId)
            {
                builder.Add("id", name);
            }
            builder.Add("name", name);
            string editClass = field.Edit == null ? null : field.Edit.Class;

            if (!isHidden)
            {
                builder.Add("class", HtmlCommonUtil.MergeClass("form-control", editClass));
                builder.Add("data-title", field.DisplayName);
            }
            else if (!string.IsNullOrEmpty(editClass))
            {
                builder.Add("class", editClass);
            }
            if (field.Edit != null)
            {
                builder.AddRange(field.Edit.AttributeList);
            }
        }
コード例 #4
0
 public static string EditCaption(string nickName, string caption, int col, string @class)
 {
     return(string.Format(ObjectUtil.SysCulture,
                          "<label for=\"{0}\" class=\"{1}\">{2}</label>", nickName,
                          HtmlCommonUtil.MergeClass(GetColClass(col), @class), caption));
 }