public static ListItem GetListItem(ERollingType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public static bool Equals(ERollingType type, string typeStr) { if (string.IsNullOrEmpty(typeStr)) { return(false); } if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower())) { return(true); } return(false); }
public AdvertisementFloatImageInfo(bool isCloseable, EPositionType positionType, int positionX, int positionY, ERollingType rollingType, string navigationUrl, string imageUrl, int height, int width) { IsCloseable = isCloseable; PositionType = positionType; PositionX = positionX; PositionY = positionY; RollingType = rollingType; NavigationUrl = navigationUrl; ImageUrl = imageUrl; Height = height; Width = width; }
public static string GetText(ERollingType type) { if (type == ERollingType.Static) { return("静止不动"); } if (type == ERollingType.FollowingScreen) { return("跟随窗体滚动"); } if (type == ERollingType.FloatingInWindow) { return("在窗体中不断移动"); } throw new Exception(); }
public static string GetValue(ERollingType type) { if (type == ERollingType.Static) { return("Static"); } if (type == ERollingType.FollowingScreen) { return("FollowingScreen"); } if (type == ERollingType.FloatingInWindow) { return("FloatingInWindow"); } throw new Exception(); }
public static void AddListItems(ListControl listControl, ERollingType rollingType) { if (listControl != null) { if (rollingType == ERollingType.Static) { listControl.Items.Add(GetListItem(EPositionType.LeftTop, false)); listControl.Items.Add(GetListItem(EPositionType.LeftBottom, false)); listControl.Items.Add(GetListItem(EPositionType.RightTop, false)); listControl.Items.Add(GetListItem(EPositionType.RightBottom, false)); } else if (rollingType == ERollingType.FollowingScreen) { listControl.Items.Add(GetListItem(EPositionType.LeftBottom, false)); listControl.Items.Add(GetListItem(EPositionType.RightBottom, false)); } else if (rollingType == ERollingType.FloatingInWindow) { listControl.Items.Add(GetListItem(EPositionType.LeftTop, false)); } } }
public static bool Equals(string typeStr, ERollingType type) { return(Equals(type, typeStr)); }
private static bool Equals(ERollingType type, string typeStr) { return(!string.IsNullOrEmpty(typeStr) && string.Equals(GetValue(type).ToLower(), typeStr.ToLower())); }