mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 01:51:29 -07:00
Add soft termination for settings window
This commit is contained in:
parent
81c6512055
commit
fe04b468b0
@ -66,6 +66,15 @@ namespace Bloxstrap
|
|||||||
Environment.Exit(exitCodeNum);
|
Environment.Exit(exitCodeNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SoftTerminate(ErrorCode exitCode = ErrorCode.ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
int exitCodeNum = (int)exitCode;
|
||||||
|
|
||||||
|
Logger.WriteLine("App::SoftTerminate", $"Terminating with exit code {exitCodeNum} ({exitCode})");
|
||||||
|
|
||||||
|
Current.Dispatcher.Invoke(() => Current.Shutdown(exitCodeNum));
|
||||||
|
}
|
||||||
|
|
||||||
void GlobalExceptionHandler(object sender, DispatcherUnhandledExceptionEventArgs e)
|
void GlobalExceptionHandler(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
|
@ -102,7 +102,7 @@ namespace Bloxstrap.UI.Elements.Settings
|
|||||||
App.State.Save();
|
App.State.Save();
|
||||||
|
|
||||||
if (!e.Cancel)
|
if (!e.Cancel)
|
||||||
App.Terminate();
|
App.SoftTerminate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user