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(); }
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(); }
public static ListItem GetListItem(ESearchEngineType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
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); }
public static bool Equals(string typeStr, ESearchEngineType type) { return(Equals(type, typeStr)); }