Пример #1
0
 /// <summary>
 /// 页码显示模式
 /// </summary>
 /// <param name="o"></param>
 /// <param name="defaultValue"></param>
 /// <returns></returns>
 /// <remarks>
 /// 页码显示模式
 /// </remarks>
 public static PagerCodeShowMode ParsePageCodeShowMode(object o, PagerCodeShowMode defaultValue)
 {
     if (o == null || o.ToString() == "")
     {
         return(defaultValue);
     }
     try
     {
         return((PagerCodeShowMode)Enum.Parse(typeof(PagerCodeShowMode), o.ToString(), true));
     }
     catch
     {
         throw new FormatException("'" + o.ToString() + "' 类型改变失败");
     }
 }
Пример #2
0
 /// <summary>
 /// 页码显示模式
 /// </summary>
 /// <param name="o"></param>
 /// <param name="defaultValue"></param>
 /// <returns></returns>
 /// <remarks>
 /// 页码显示模式
 /// </remarks>
 public static PagerCodeShowMode ParsePageCodeShowMode(object o, PagerCodeShowMode defaultValue)
 {
     if (o == null || o.ToString() == "")
     {
         return defaultValue;
     }
     try
     {
         return (PagerCodeShowMode)Enum.Parse(typeof(PagerCodeShowMode), o.ToString(), true);
     }
     catch
     {
         throw new FormatException("'" + o.ToString() + "' 类型改变失败");
     }
 }