public static ListItem GetListItem(EStlContentOrder type, bool selected)
        {
            var item = new ListItem(GetValue(type) + " (" + GetText(type) + ")", GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
 public static bool Equals(EStlContentOrder type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
 public static string GetText(EStlContentOrder type)
 {
     if (type == EStlContentOrder.Default)
     {
         return("默认排序,即内容管理界面中的排序");
     }
     else if (type == EStlContentOrder.Back)
     {
         return("默认排序的相反方向");
     }
     else if (type == EStlContentOrder.AddDate)
     {
         return("按添加时间排序");
     }
     else if (type == EStlContentOrder.AddDateBack)
     {
         return("按添加时间的相反方向排序");
     }
     else if (type == EStlContentOrder.LastEditDate)
     {
         return("按最后更改时间排序");
     }
     else if (type == EStlContentOrder.LastEditDateBack)
     {
         return("按最后更改时间的相反方向排序");
     }
     else if (type == EStlContentOrder.Hits)
     {
         return("按点击量排序");
     }
     else if (type == EStlContentOrder.HitsByDay)
     {
         return("按日点击量排序");
     }
     else if (type == EStlContentOrder.HitsByWeek)
     {
         return("按周点击量排序");
     }
     else if (type == EStlContentOrder.HitsByMonth)
     {
         return("按月点击量排序");
     }
     else if (type == EStlContentOrder.Stars)
     {
         return("按评分数排序");
     }
     else if (type == EStlContentOrder.Digg)
     {
         return("按点评数排序");
     }
     else if (type == EStlContentOrder.Comments)
     {
         return("按评论数排序");
     }
     else if (type == EStlContentOrder.Random)
     {
         return("随机显示内容");
     }
     else
     {
         throw new Exception();
     }
 }
 public static string GetValue(EStlContentOrder type)
 {
     if (type == EStlContentOrder.Default)
     {
         return("Default");
     }
     else if (type == EStlContentOrder.Back)
     {
         return("Back");
     }
     else if (type == EStlContentOrder.AddDate)
     {
         return("AddDate");
     }
     else if (type == EStlContentOrder.AddDateBack)
     {
         return("AddDateBack");
     }
     else if (type == EStlContentOrder.LastEditDate)
     {
         return("LastEditDate");
     }
     else if (type == EStlContentOrder.LastEditDateBack)
     {
         return("LastEditDateBack");
     }
     else if (type == EStlContentOrder.Hits)
     {
         return("Hits");
     }
     else if (type == EStlContentOrder.HitsByDay)
     {
         return("HitsByDay");
     }
     else if (type == EStlContentOrder.HitsByWeek)
     {
         return("HitsByWeek");
     }
     else if (type == EStlContentOrder.HitsByMonth)
     {
         return("HitsByMonth");
     }
     else if (type == EStlContentOrder.Stars)
     {
         return("Stars");
     }
     else if (type == EStlContentOrder.Digg)
     {
         return("Digg");
     }
     else if (type == EStlContentOrder.Comments)
     {
         return("Comments");
     }
     else if (type == EStlContentOrder.Random)
     {
         return("Random");
     }
     else
     {
         throw new Exception();
     }
 }
 public static bool Equals(string typeStr, EStlContentOrder type)
 {
     return(Equals(type, typeStr));
 }