public UserListRow(PnlUserList parent, GPG.Multiplayer.Quazal.User user, UserListStyles style, UserListCategories initialCategory) { this.PlayerAwards = null; this.PlayerStatus = null; this.mCategory = UserListCategories.Online; this.mPreviousRow = null; this.mNextRow = null; this.mIsSelected = false; this.LastCategory = null; this.ClanRankImage = null; this.Award1Image = null; this.Award2Image = null; this.Award3Image = null; this.AvatarImage = null; this.StatusImage = null; this.ClanLabelBounds = null; this.mParent = parent; this.mUser = user; this.mStyle = style; this.mCategory = initialCategory; this.Parent.MouseMove += new MouseEventHandler(this.Parent_MouseMove); this.Parent.MouseDown += new MouseEventHandler(this.Parent_MouseDown); this.Parent.MouseUp += new MouseEventHandler(this.Parent_MouseUp); this.BindToUser(this.User); }
public void BindToList(UserListStyles style) { this.mIsBound = false; this.ClearData(); foreach (UserListCategory category in this.Categories.Values) { category.ExpandContractChanged += new EventHandler(this.category_ExpandContractChanged); category.VisibleChanged += new EventHandler(this.category_VisibleChanged); category.Dispose(); } this.mCategories.Clear(); this.mStyle = style; switch (style) { case UserListStyles.Chatroom: this.Categories.Add(UserListCategories.Admin, new UserListCategory(this, UserListCategories.Admin, style)); this.Categories.Add(UserListCategories.Moderator, new UserListCategory(this, UserListCategories.Moderator, style)); this.Categories.Add(UserListCategories.Speaking, new UserListCategory(this, UserListCategories.Speaking, style)); this.Categories.Add(UserListCategories.Friend, new UserListCategory(this, UserListCategories.Friend, style)); this.Categories.Add(UserListCategories.Clan, new UserListCategory(this, UserListCategories.Clan, style)); this.Categories.Add(UserListCategories.Online, new UserListCategory(this, UserListCategories.Online, style)); this.Categories.Add(UserListCategories.Away, new UserListCategory(this, UserListCategories.Away, style)); break; case UserListStyles.OnlineOffline: this.Categories.Add(UserListCategories.Online, new UserListCategory(this, UserListCategories.Online, style)); this.Categories.Add(UserListCategories.Offline, new UserListCategory(this, UserListCategories.Offline, style)); break; case UserListStyles.Clan: this.Categories.Add(UserListCategories.Clan_Rank0, new UserListCategory(this, UserListCategories.Clan_Rank0, style)); this.Categories.Add(UserListCategories.Clan_Rank1, new UserListCategory(this, UserListCategories.Clan_Rank1, style)); this.Categories.Add(UserListCategories.Clan_Rank2, new UserListCategory(this, UserListCategories.Clan_Rank2, style)); this.Categories.Add(UserListCategories.Clan_Rank3, new UserListCategory(this, UserListCategories.Clan_Rank3, style)); this.Categories.Add(UserListCategories.Clan_Rank4, new UserListCategory(this, UserListCategories.Clan_Rank4, style)); this.Categories.Add(UserListCategories.Clan_Rank5, new UserListCategory(this, UserListCategories.Clan_Rank5, style)); break; } foreach (UserListCategory category in this.Categories.Values) { category.ExpandContractChanged += new EventHandler(this.category_ExpandContractChanged); category.VisibleChanged += new EventHandler(this.category_VisibleChanged); } this.mIsBound = true; }