Beispiel #1
0
        public void RemoveUnit(IUnit unit)
        {
            string recentID = RecentListBox.ConstructRecentID(unit);

            this.chatListBox.RemoveSubItemsById(recentID);
            this.chatListBox.Invalidate();
        }
Beispiel #2
0
        public void AddRecentUnit(IUnit unit, int insertIndex)
        {
            string          recentID = RecentListBox.ConstructRecentID(unit);
            UserStatus      status   = unit.IsGroup ? UserStatus.Online : ((IUser)unit).UserStatus;
            Image           img      = unit.IsGroup ? this.imageList1.Images[0] : this.resourceGetter.GetHeadImage((IUser)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();
        }
Beispiel #3
0
        public void UserStatusChanged(IUser 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();
        }
Beispiel #4
0
        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();
        }