diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-23 08:44:31 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-23 08:44:31 +0300 |
| commit | 02ae577faa0bd4938507061d603e4f9447e2b64f (patch) | |
| tree | 7daf0e275338ec92e93bfca39f2d529d93858162 /Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs | |
| parent | 67770063ff1a1c5c522e3bc29f442c42eb6dc521 (diff) | |
| download | Tango-02ae577faa0bd4938507061d603e4f9447e2b64f.tar.gz Tango-02ae577faa0bd4938507061d603e4f9447e2b64f.zip | |
Fixed issue with insights file datetime utc.
added insights application exception/crash.
added remote actions service.
fixed issue with LiteDB hang on application start/exit.
reduced insights listener empty frames.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs index 16eb656a8..e478dba77 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs @@ -13,6 +13,7 @@ using Tango.BL; using Tango.Core; using Tango.Core.DI; using Tango.Core.Helpers; +using Tango.Insights; using Tango.Integration.Operation; using Tango.Logging; using Tango.PPC.Common; @@ -29,7 +30,7 @@ namespace Tango.PPC.UI /// </summary> public partial class App : Application { - private WpfGlobalExceptionTrapper exceptionTrapper; + public static WpfGlobalExceptionTrapper ExceptionTrapper; public static String[] StartupArgs { get; private set; } private LogManager LogManager = LogManager.Default; @@ -80,9 +81,9 @@ namespace Tango.PPC.UI base.OnStartup(e); - exceptionTrapper = new WpfGlobalExceptionTrapper(); - exceptionTrapper.Initialize(this); - exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed; + ExceptionTrapper = new WpfGlobalExceptionTrapper(); + ExceptionTrapper.Initialize(this); + ExceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed; CoreSettings.DefaultDataSource = new DataSource() { @@ -100,10 +101,21 @@ namespace Tango.PPC.UI private async void GetLastApplicationCrashFromWindows() { - var logItem = await exceptionTrapper.GetLastApplicationCrashEventLog(); + var logItem = await ExceptionTrapper.GetLastApplicationCrashEventLog(60); if (logItem != null) { LogManager.Log(logItem); + + try + { + InsightsManager.Default.InsertApplicationException(new InsightsApplicationException() + { + Time = DateTime.UtcNow, + Exception = logItem.Message, + IsApplicationCrash = true + }); + } + catch { } } } @@ -135,6 +147,17 @@ namespace Tango.PPC.UI try { + InsightsManager.Default.InsertApplicationException(new InsightsApplicationException() + { + Time = DateTime.UtcNow, + Exception = e.Exception.ToString() + }); + } + catch + { } + + try + { if (Application.Current == null) { new Application { ShutdownMode = ShutdownMode.OnExplicitShutdown }; |
