protected override void OnExit(ExitEventArgs e)
 {
     Settings.Save();
     LogToFile.LogDebug("App exiting");
     LogToFile.Close();
     base.OnExit(e);
 }
 protected override void OnStartup(StartupEventArgs e)
 {
     LogToFile.LogDebug("App started");
     Settings.Load();
     base.OnStartup(e);
     AppDomain.CurrentDomain.UnhandledException += AppDomain_CurrentDomain_UnhandledException;
 }