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); }