private void prvConvWindow_FormClosed(object sender, FormClosedEventArgs e) { //TODO : filter send to server by ifremoved from list<> privateConversation _temp = (privateConversation)sender; _temp.Dispose(); for (int index = 0; index < prvConversations.Count; index++) { if (prvConversations[index] == _temp) { prvConversations.Remove(_temp); closePrivate closePrv = new closePrivate(); closePrv.setWhoSent(username); closePrv.setToWho(_temp.withWho); dataTypes objectToSend = new dataTypes(); objectToSend.setType(typeof(closePrivate).ToString()); objectToSend.setObject(closePrv); netServ.sendObjectToServer(objectToSend); break; } } }
internal void closePrivate(closePrivate closePrv) { privateConversation thisConversation = getWindowByUser(closePrv.whoSent); thisConversation.disableControls(); prvConversations.Remove(thisConversation); }
private void showPrivateWindow(object data) { privateConversation thisConversation = new privateConversation((string)data, this, netServ); prvConversations.Add(thisConversation); thisConversation.FormClosed += new FormClosedEventHandler(prvConvWindow_FormClosed); thisConversation.Text = "PRV: " + (string)data; thisConversation.ShowDialog(); }
internal void pushPrivateToWindow(privateMessage prvMsg) { privateConversation thisConv = getWindowByUser(prvMsg.whoSent); thisConv.appendText("[" + prvMsg.whoSent + "] " + prvMsg.message); }