private void NewSingleChat(string remoteIP, string NickName, string msg) { SingleChatWindow window = new SingleChatWindow { RemoteIP = remoteIP }; window.SetNickName(NickName); instance.singleWindows.Add(window); window.Show(); if (!msg.Equals(string.Empty)) { window.NewMessage(msg); } }
private void ListBoxItem_MouseDoubleClick(object sender, RoutedEventArgs e) { User user = (User)Lb_Member.SelectedItem; SingleChatWindow window = instance.singleWindows.Find(x => x.RemoteIP.Equals(user.IP)); if (window != null) { window.Focus(); return; } else { window = new SingleChatWindow() { RemoteIP = user.IP }; window.SetNickName(user.NickName); instance.singleWindows.Add(window); window.Show(); } }