protected override void OnExit(ExitEventArgs e)
 {
     Settings.Save();
     LogToFile.LogDebug("App exiting");
     LogToFile.Close();
     base.OnExit(e);
 }
 void AppDomain_CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     LogToFile.LogError("CRASH:", e.ExceptionObject as Exception);
     LogToFile.Close();
 }