mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-25 16:11:49 +01:00
Save settings on log off or shutdown
This commit is contained in:
parent
3074bc1b6e
commit
489d13d02f
@ -2,7 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:DS4WinWPF"
|
||||
Startup="Application_Startup" Exit="Application_Exit" ShutdownMode="OnExplicitShutdown">
|
||||
Startup="Application_Startup" Exit="Application_Exit" ShutdownMode="OnExplicitShutdown" SessionEnding="Application_SessionEnding">
|
||||
<Application.Resources>
|
||||
<Style TargetType="{x:Type Button}" x:Key="NoBGHoverBtn">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
|
@ -429,6 +429,20 @@ namespace DS4WinWPF
|
||||
}
|
||||
|
||||
private void Application_Exit(object sender, ExitEventArgs e)
|
||||
{
|
||||
Logger logger = logHolder.Logger;
|
||||
logger.Info("Request App Shutdown");
|
||||
CleanShutdown();
|
||||
}
|
||||
|
||||
private void Application_SessionEnding(object sender, SessionEndingCancelEventArgs e)
|
||||
{
|
||||
Logger logger = logHolder.Logger;
|
||||
logger.Info("User Session Ending");
|
||||
CleanShutdown();
|
||||
}
|
||||
|
||||
private void CleanShutdown()
|
||||
{
|
||||
if (runShutdown)
|
||||
{
|
||||
@ -456,6 +470,9 @@ namespace DS4WinWPF
|
||||
|
||||
if (ipcClassNameMMA != null) ipcClassNameMMA.Dispose();
|
||||
if (ipcClassNameMMF != null) ipcClassNameMMF.Dispose();
|
||||
|
||||
LogManager.Flush();
|
||||
LogManager.Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user