Example #1
0
 public static string GetText(ESearchEngineType type)
 {
     if (type == ESearchEngineType.Baidu)
     {
         return("百度");
     }
     if (type == ESearchEngineType.Google_CN)
     {
         return("Google(简体中文)");
     }
     if (type == ESearchEngineType.Google)
     {
         return("Google(全部语言)");
     }
     if (type == ESearchEngineType.Yahoo)
     {
         return("Yahoo");
     }
     if (type == ESearchEngineType.Live)
     {
         return("Live 搜索");
     }
     if (type == ESearchEngineType.Sogou)
     {
         return("搜狗");
     }
     throw new Exception();
 }
Example #2
0
 public static string GetValue(ESearchEngineType type)
 {
     if (type == ESearchEngineType.Baidu)
     {
         return("Baidu");
     }
     if (type == ESearchEngineType.Google)
     {
         return("Google");
     }
     if (type == ESearchEngineType.Google_CN)
     {
         return("Google_CN");
     }
     if (type == ESearchEngineType.Live)
     {
         return("Live");
     }
     if (type == ESearchEngineType.Sogou)
     {
         return("Sogou");
     }
     if (type == ESearchEngineType.Yahoo)
     {
         return("Yahoo");
     }
     throw new Exception();
 }
Example #3
0
        public static ListItem GetListItem(ESearchEngineType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Example #4
0
 public static bool Equals(ESearchEngineType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Example #5
0
 public static bool Equals(string typeStr, ESearchEngineType type)
 {
     return(Equals(type, typeStr));
 }