コード例 #1
0
        public void RemoveUnit(IUnit unit)
        {
            string recentID = RecentListBox.ConstructRecentID(unit);

            this.chatListBox.RemoveSubItemsById(recentID);
            this.chatListBox.Invalidate();
        }
コード例 #2
0
        public void RemoveUser(string userID)
        {
            string recentID = RecentListBox.ConstructRecentID4User(userID);

            this.chatListBox.RemoveSubItemsById(recentID);
            this.chatListBox.Invalidate();
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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;
        }
コード例 #6
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();
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
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();
        }
コード例 #9
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();
        }