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

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Exemplo n.º 2
0
 public static bool Equals(ETableRule type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
 public static string GetText(ETableRule type)
 {
     if (type == ETableRule.Choose)
     {
         return("选择内容表");
     }
     if (type == ETableRule.HandWrite)
     {
         return("指定内容表");
     }
     if (type == ETableRule.Create)
     {
         return("创建新的内容表");
     }
     throw new Exception();
 }
Exemplo n.º 4
0
 public static string GetValue(ETableRule type)
 {
     if (type == ETableRule.Choose)
     {
         return("Choose");
     }
     if (type == ETableRule.HandWrite)
     {
         return("HandWrite");
     }
     if (type == ETableRule.Create)
     {
         return("Create");
     }
     throw new Exception();
 }
Exemplo n.º 5
0
 public static bool Equals(string typeStr, ETableRule type)
 {
     return(Equals(type, typeStr));
 }