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); }
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); }
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); }
public void AddToWsUserLog(SeNetworkService.SeUser user, int pos, string action, bool updateUI) { for (int i = 0; i < UpdateLog.Count; i++) { if (UpdateLog[i].Index == pos) { UpdateLog.RemoveAt(i); break; } } UpdateLog.Add(new UpdateLogEntry(0, user.UserName, pos, action)); if (updateUI && OnUpdateUserLogEntries != null) OnUpdateUserLogEntries.Invoke(null, null); }