public static void Exit(Main main) { try { AuthorizationWindow window = new AuthorizationWindow(); window.Show(); main.Close(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }