Cancel auto exit when the user do an action.

This commit is contained in:
Tichau committed 2015-05-27 11:16:10 +02:00
1 parent 18d616050a
commit b4058b2ed6
2 files changed
+15

No files matched your search

@@ -33,6 +33,7 @@ namespace FileConverter
private bool debugMode;
private bool initialized;
private bool cancelAutoExit;
public Application()
{
@@ -79,6 +80,11 @@ namespace FileConverter
set;
}
public void CancelAutoExit()
{
this.cancelAutoExit = true;
}
private void Initialize()
{
// Load settigns.
@@ -238,6 +244,11 @@ namespace FileConverter
{
System.Threading.Thread.Sleep(3000);
if (this.cancelAutoExit)
{
return;
}
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
}
#endif
@@ -76,6 +76,8 @@ namespace FileConverter
this.diagnosticsWindow = new DiagnosticsWindow();
}
Application application = Application.Current as Application;
application?.CancelAutoExit();
this.diagnosticsWindow.Show();
}
@@ -90,6 +92,8 @@ namespace FileConverter
this.settingsWindow = new SettingsWindow();
}
Application application = Application.Current as Application;
application?.CancelAutoExit();
this.settingsWindow.Show();
}
}