private void SessionOnChatRoomJoined(object sender, ChatRoomStatusUpdateEventArgs chatStatusUpdateEventArgs) { AddChat(chatStatusUpdateEventArgs.ChatRoom); }
private void SessionOnChatRoomLeft(object sender, ChatRoomStatusUpdateEventArgs chatStatusUpdateEventArgs) { // find the tabpage to remove TabPage tabPageToRemove = null; foreach (var tabPage in tcChats.TabPages) { var chatRoom = (tabPage as TabPage).Tag as ChatRoom; if (chatRoom == chatStatusUpdateEventArgs.ChatRoom) { tabPageToRemove = tabPage as TabPage; } } tcChats.TabPages.Remove(tabPageToRemove); }