示例#1
0
        /// <summary>
        /// 解析 SearchColumnSettings 字段
        /// </summary>
        /// <param name="attr"></param>
        /// <returns></returns>
        public static Dictionary <string, string> ExplainSearchColumnSettings(DynamicDataGridSearchColAttribute attr)
        {
            var ret = new Dictionary <string, string>();

            if (null == attr)
            {
                return(ret);
            }

            var str = attr.SearchColumnSettings;

            if (string.IsNullOrEmpty(str))
            {
                return(ret);
            }

            var fieldArr = str.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

            if (0 == fieldArr.Length)
            {
                return(ret);
            }

            foreach (var eField in fieldArr)
            {
                var lineArr = eField.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);

                if (2 != lineArr.Length)
                {
                    continue;
                }

                ret.Add(lineArr[0], lineArr[1]);
            }

            return(ret);
        }
示例#2
0
 /// <summary>
 /// 解析 DynamicDataGridSearchColAttribute的SearchColumnSettings 字段
 /// </summary>
 /// <param name="attr"></param>
 /// <returns></returns>
 public static Dictionary <string, string> ExplainSearchColumnSettings(this DynamicDataGridSearchColAttribute attr)
 {
     return(DynamicDataGridSearchColAttribute.ExplainSearchColumnSettings(attr));
 }