Handle session terminating for windows certification purpose.

This commit is contained in:
Tichau committed 2016-02-18 19:19:00 +01:00
1 parent a583053379
commit a51d07a893
1 file changed
+11 -2
+11 -2
View File
@@ -41,6 +41,7 @@ namespace FileConverter
private bool needToRunConversionThread;
private bool cancelAutoExit;
private bool isSessionEnding;
private UpgradeVersionDescription upgradeVersionDescription = null;
public Application()
@@ -48,6 +49,14 @@ namespace FileConverter
this.ConvertionJobs = this.conversionJobs.AsReadOnly();
}
protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
{
base.OnSessionEnding(e);
this.isSessionEnding = true;
this.Shutdown();
}
public static Version ApplicationVersion
{
get
@@ -109,8 +118,8 @@ namespace FileConverter
base.OnExit(e);
Debug.Log("Exit application.");
if (this.upgradeVersionDescription != null && this.upgradeVersionDescription.NeedToUpgrade)
if (!this.isSessionEnding && this.upgradeVersionDescription != null && this.upgradeVersionDescription.NeedToUpgrade)
{
Debug.Log("A new version of file converter has been found: {0}.", this.upgradeVersionDescription.LatestVersion);