private void LbClients_DoubleClick(object sender, EventArgs e) { if (lbClients.SelectedItem == null) { return; } string userNickname = lbClients.SelectedItem.ToString(); User user = users.Find(u => u.Nickname.Equals(userNickname)); clientForm frm = new clientForm(user); frm.OnSendButtonPressed += OnSendButtonPressedHandler; frm.OnClientFormClosing += OnClientFormClosingHandler; frm.Show(); remoteScreens.Add(frm); }
void OnClientFormClosingHandler(clientForm frm) { remoteScreens.Remove(frm); }