mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-20 09:32:54 +01:00
Handle session terminating for windows certification purpose.
This commit is contained in:
1 parent
a583053379
commit
a51d07a893
1 file changed
+11
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user