From afd1b9843ccd81d9d09eb649aa2d1e51976aabd1 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 10 Nov 2014 14:52:04 +0000 Subject: [PATCH] added comment, and changed exit code --- Saviour Backup System/setup.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Saviour Backup System/setup.cs b/Saviour Backup System/setup.cs index ee0ca83..a9b4521 100644 --- a/Saviour Backup System/setup.cs +++ b/Saviour Backup System/setup.cs @@ -17,13 +17,15 @@ namespace Saviour_Backup_System internal static string[] runtimeArguements = null; internal static mainWindow MW; internal static notificationIcon icon; - internal static string username = Environment.UserName; + internal static string username = Environment.UserName; //snapshots the username internal static void initProgram(string[] args) { runtimeArguements = args; icon = new notificationIcon(); MW = new mainWindow(); + //databaseTools.init(); + MW.showDisplay(); Application.Run(MW); } @@ -33,7 +35,12 @@ namespace Saviour_Backup_System { string exitMessage = "Are you sure you want to close Saviour Backup System? \n All copying backups and backup scanning will cease."; DialogResult result = MessageBox.Show(exitMessage, "Saviour Backup System Exiting...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - if ( result == System.Windows.Forms.DialogResult.Yes) { Application.Exit(); } + if (result == System.Windows.Forms.DialogResult.Yes) { + icon.notifyIcon.Dispose(); + MW.removeDisplay(); + MW.Dispose(); + Environment.Exit(0); + } } } }