public void RemoveUnit(IUnit unit) { string recentID = RecentListBox.ConstructRecentID(unit); this.chatListBox.RemoveSubItemsById(recentID); this.chatListBox.Invalidate(); }
public void RemoveUser(string userID) { string recentID = RecentListBox.ConstructRecentID4User(userID); this.chatListBox.RemoveSubItemsById(recentID); this.chatListBox.Invalidate(); }
private void chatListBox_DoubleClickSubItem(object sender, ChatListEventArgs e) { Parameter <string, bool> para = RecentListBox.ParseIDFromRecentID(e.SelectSubItem.ID); if (this.UnitDoubleClicked != null) { this.UnitDoubleClicked(para.Arg1, para.Arg2); } }
private void toolStripMenuItem3_Click(object sender, EventArgs e) { ChatListSubItem item = this.chatListBox.SelectSubItem; Parameter <string, bool> para = RecentListBox.ParseIDFromRecentID(item.ID); if (this.ChatRecordClicked != null) { this.ChatRecordClicked(para.Arg1, para.Arg2); } }
public void SetTwinkleState(string id, bool isGroup, bool twinkle) { string recentID = isGroup ? RecentListBox.ConstructRecentID4Group(id) : RecentListBox.ConstructRecentID4User(id); ChatListSubItem[] items = this.chatListBox.GetSubItemsById(recentID); if (items == null || items.Length == 0) { return; } items[0].IsTwinkle = twinkle; }
public void AddRecentUnit(IUnit unit, int insertIndex) { string recentID = RecentListBox.ConstructRecentID(unit); UserStatus status = unit.IsGroup ? UserStatus.Online : ((GGUser)unit).UserStatus; Image img = unit.IsGroup ? this.imageList1.Images[0] : this.resourceGetter.GetHeadImage((GGUser)unit); ChatListSubItem subItem = new ChatListSubItem(recentID, "", unit.Name, "", this.ConvertUserStatus(status), img); subItem.Tag = unit; subItem.LastWords = unit.LastWords; this.chatListBox.Items[0].SubItems.Insert(insertIndex, subItem); this.chatListBox.Invalidate(); }
private void toolStripMenuItem2_Click(object sender, EventArgs e) { ChatListSubItem item = this.chatListBox.SelectSubItem; item.IsTwinkle = false; Parameter <string, bool> para = RecentListBox.ParseIDFromRecentID(item.ID); if (this.UnitDoubleClicked != null) { this.UnitDoubleClicked(para.Arg1, para.Arg2); } }
public void UserStatusChanged(GGUser user) { string recentID = RecentListBox.ConstructRecentID(user); ChatListSubItem[] items = this.chatListBox.GetSubItemsById(recentID); if (items == null || items.Length == 0) { return; } items[0].DisplayName = user.Name; items[0].HeadImage = this.resourceGetter.GetHeadImage(user); items[0].Status = this.ConvertUserStatus(user.UserStatus); this.chatListBox.Invalidate(); }
public void LastWordChanged(IUnit unit) { string recentID = RecentListBox.ConstructRecentID(unit); ChatListSubItem[] items = this.chatListBox.GetSubItemsById(recentID); if (items != null && items.Length > 0) { ChatListSubItem item = items[0]; item.LastWords = unit.LastWords; item.OwnerListItem.SubItems.Remove(item); item.OwnerListItem.SubItems.Insert(0, item); } else { this.AddRecentUnit(unit, 0); } this.chatListBox.Invalidate(); }