summaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-14 20:09:19 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-14 20:09:19 +0300
commitef22b8bc38d2f82b9939c2b6ff6a47d36abbe25b (patch)
treee8a6ad246928442b20edf17ed098d1acba0add9e /Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs
parent3d6c698db7add1bc7825f3b67611f0c18fe07e1d (diff)
downloadTango-ef22b8bc38d2f82b9939c2b6ff6a47d36abbe25b.tar.gz
Tango-ef22b8bc38d2f82b9939c2b6ff6a47d36abbe25b.zip
Improved FSE application termination analysis using settings. (increased crash report history to 1 hour instead of 10 minutes)
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs30
1 files changed, 28 insertions, 2 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs
index 6bec431fa..8f0b97d2b 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs
@@ -95,14 +95,40 @@ namespace Tango.FSE.UI
exceptionTrapper.Initialize(this);
exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed;
- GetLastApplicationCrashFromWindows();
+ if (!Debugger.IsAttached)
+ {
+ ProcessLastApplicationTermination();
+ }
}
#region Global Exception Trapping
+ private void ProcessLastApplicationTermination()
+ {
+ try
+ {
+ LogManager.Log("Analyzing previous application termination state...");
+
+ var settings = SettingsManager.Default.GetOrCreate<FSESettings>();
+
+ if (!settings.TerminatedExpectedly)
+ {
+ GetLastApplicationCrashFromWindows();
+ }
+
+ settings.TerminatedExpectedly = false;
+ settings.Save();
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error occurred while processing application last termination state.");
+ }
+ }
+
private async void GetLastApplicationCrashFromWindows()
{
- var logItem = await exceptionTrapper.GetLastApplicationCrashEventLog();
+ //Try find event log crash reports from the last 60 minutes...
+ var logItem = await exceptionTrapper.GetLastApplicationCrashEventLog(60);
if (logItem != null)
{
IsStartedAfterCrash = true;