Esempio n. 1
0
        public static ListItem GetListItem(EMenuDisplayType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Esempio n. 2
0
 public static bool Equals(EMenuDisplayType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
 public static string GetText(EMenuDisplayType type)
 {
     if (type == EMenuDisplayType.UseChildrenNodeToDisplay)
     {
         return("显示此栏目的子栏目");
     }
     else if (type == EMenuDisplayType.UseNodeGroupToDisplay)
     {
         return("显示属于栏目组中的栏目");
     }
     else if (type == EMenuDisplayType.Both)
     {
         return("显示同时满足以上两条件的栏目");
     }
     else
     {
         throw new Exception();
     }
 }
Esempio n. 4
0
 public static string GetValue(EMenuDisplayType type)
 {
     if (type == EMenuDisplayType.UseChildrenNodeToDisplay)
     {
         return("UseChildrenNodeToDisplay");
     }
     else if (type == EMenuDisplayType.UseNodeGroupToDisplay)
     {
         return("UseNodeGroupToDisplay");
     }
     else if (type == EMenuDisplayType.Both)
     {
         return("Both");
     }
     else
     {
         throw new Exception();
     }
 }
Esempio n. 5
0
 public static bool Equals(string typeStr, EMenuDisplayType type)
 {
     return(Equals(type, typeStr));
 }