From 6e2eeb6829b2b1bf5e1e5334b9dad84f10ce2bc1 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 1 Mar 2018 14:24:25 +0200 Subject: Upgraded protobuf from 4.1 to 5.1 ? Implemented a workaround for protobuf ToByteString bug. Lowered Transporter Push/Pull Interval from 2 to 1 mili. Set No Alpha Channel as default on color canvas. Fixed issue with single graphs colors on technician module. --- .../Tango.MachineStudio.UI/App.xaml.cs | 50 ++++++++++++++-------- 1 file changed, 32 insertions(+), 18 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs index 112fde2cf..b2f869d4c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -4,8 +4,10 @@ using System.Configuration; using System.Data; using System.Diagnostics; using System.Linq; +using System.Threading; using System.Threading.Tasks; using System.Windows; +using Tango.Core.Helpers; using Tango.Integration.Observables; using Tango.Logging; using Tango.MachineStudio.UI.Windows; @@ -56,26 +58,38 @@ namespace Tango.MachineStudio.UI /// The instance containing the event data. private void ExceptionTrapper_ApplicationCrashed(object sender, ApplicationCrashedEventArgs e) { - ExceptionWindow exWin = new ExceptionWindow(e.Exception); - exWin.ShowDialog(); - - switch (exWin.Resolution) + try { - case ExceptionResolutions.Ignore: - e.TryRecover = true; - break; - case ExceptionResolutions.Restart: - e.TryRecover = false; - LogManager.Log("User selection was to restart the application. Restarting..."); - Process.Start(Application.ResourceAssembly.Location); - Environment.Exit(0); - break; - case ExceptionResolutions.Shutdown: - e.TryRecover = false; - LogManager.Log("User selection was to shutdown the application. Restarting..."); - Environment.Exit(0); - break; + if (Application.Current == null) + { + new Application { ShutdownMode = ShutdownMode.OnExplicitShutdown }; + } } + catch { } + + Application.Current.Dispatcher.Invoke(() => + { + ExceptionWindow exWin = new ExceptionWindow(e.Exception); + exWin.ShowDialog(); + + switch (exWin.Resolution) + { + case ExceptionResolutions.Ignore: + e.TryRecover = true; + break; + case ExceptionResolutions.Restart: + e.TryRecover = false; + LogManager.Log("User selection was to restart the application. Restarting..."); + Process.Start(Application.ResourceAssembly.Location); + Environment.Exit(0); + break; + case ExceptionResolutions.Shutdown: + e.TryRecover = false; + LogManager.Log("User selection was to shutdown the application. Restarting..."); + Environment.Exit(0); + break; + } + }); } #endregion -- cgit v1.3.1