void clientCallback_ReceivedUserList(object sender, WPFChat.Library.GenericEventArgs<ClientInfo[]> e) { LoadChatList(e.Data); for (int i = tabChatWindows.Items.Count-1; i>=0; i--) { TabItem ti = (TabItem)tabChatWindows.Items[i]; if (ti.Content is ChatControl) { string id = ((ChatControl)ti.Content).IdToTalkTo; if ((e.Data.Where(p => p.LoginId == id)).Count() == 0) { tabChatWindows.Items.RemoveAt(i); } } } }
void cc_SendMessage(object sender, WPFChat.Library.GenericEventArgs<string> e) { m_Client.SendMessage( txtLoginId.Text.Trim(), ((ChatControl)sender).IdToTalkTo, e.Data); ((ChatControl)sender).AddMessage(txtLoginId.Text.Trim(), e.Data); }