private void UserJoinedChatSafe(string username) { var listviewkey = string.Format("cht_{0}", username); if (lstChatUsers.InvokeRequired) { var d = new UserJoinedChat(UserJoinedChatSafe); Invoke(d, new object[] { username }); } else { if (!lstChatUsers.Items.ContainsKey(listviewkey)) { string tooltip = rbtechbot.GetToolTipOnUser(username); lstChatUsers.Items.Add(new ListViewItem() { Text = username, Name = string.Format("cht_{0}", username), Tag = "Name", ToolTipText = tooltip }); } WriteChatMessageSafe(new RTChatMessage() { DisplayName = username, Message = "(Joined Chat)", MessageIdStr = String.Format("Join_{0}", username) } ); } }
private void ChatClient_UserJoined(object sender, Service.Twitch.Models.ChatUserJoinedEventArgs e) { UserJoinedChat?.Invoke(this, new UserJoinedChatArgs { UserName = e.UserName }); }