Пример #1
0
        public void AddChatMessage(SeNetworkService.SeUser user, string message)
        {
            ListViewItem item = new ListViewItem(user.UserName);

            item.Tag        = _networkSession.CurrentUser;
            item.ForeColor  = Utilities.GetColorFromUserName(user.UserName);
            item.ImageIndex = Utilities.GetNumber0To7FromUserName(user.UserName);
            item.SubItems.Add(new ListViewItem.ListViewSubItem(item, message));
            listViewChat.Items.Add(item);
        }
Пример #2
0
        internal void RemoveUser(SeNetworkService.SeUser user)
        {
            ListViewItem removeItem = null;

            foreach (ListViewItem item in listViewUsers.Items)
            {
                if ((item.Tag as SeNetworkService.SeUser).UserName == user.UserName)
                {
                    removeItem = item;
                }
            }
            if (removeItem != null)
            {
                listViewUsers.Items.Remove(removeItem);
            }
        }
Пример #3
0
        internal void AddUser(SeNetworkService.SeUser user)
        {
            ListViewItem item = new ListViewItem(user.UserName);

            item.Tag       = user;
            item.ForeColor = Utilities.GetColorFromUserName(user.UserName);
            if (DateTime.Now.Month == 12 && DateTime.Now.Day >= 23 && DateTime.Now.Day <= 25)
            {
                item.ImageIndex = 7;
            }
            else
            {
                item.ImageIndex = Utilities.GetNumber0To7FromUserName(user.UserName);
            }
            item.SubItems.Add(new ListViewItem.ListViewSubItem(item, user.Ip));
            listViewUsers.Items.Add(item);
        }