public static ListItem GetListItem(EVoteItemType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public static bool Equals(EVoteItemType 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(EVoteItemType type) { if (type == EVoteItemType.Text) { return("文字型投票"); } if (type == EVoteItemType.Image) { return("图片型投票"); } if (type == EVoteItemType.TextAndImage) { return("图文混合型投票"); } throw new Exception(); }
public static string GetValue(EVoteItemType type) { if (type == EVoteItemType.Text) { return("Text"); } if (type == EVoteItemType.Image) { return("Image"); } if (type == EVoteItemType.TextAndImage) { return("TextAndImage"); } throw new Exception(); }
public static bool Equals(string typeStr, EVoteItemType type) { return(Equals(type, typeStr)); }