private void ChatWindow_FormClosing(object sender, FormClosingEventArgs e)
 {
     Console.WriteLine("ChatWindow closing " + e.CloseReason);
     if (e.CloseReason == CloseReason.UserClosing)
     {
         ctrl.Logout();
         ctrl.updateEvent -= userUpdate;
         Application.Exit();
     }
 }
Example #2
0
 private void MainWindow_FormClosed(object sender, FormClosedEventArgs e)
 {
     Controller.Logout();
     Controller.UpdateEvent -= UserUpdate;
     Application.Exit();
 }
Example #3
0
 private void Logout()
 {
     controller.Logout();
     loginForm.Show();
     Hide();
 }