diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-01 14:24:25 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-01 14:24:25 +0200 |
| commit | 6e2eeb6829b2b1bf5e1e5334b9dad84f10ce2bc1 (patch) | |
| tree | d423e90c51f380d8207a2d91cbf444a4cbcc698b /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs | |
| parent | f185c2ba392d7a05079ca1c3e27521bac053a103 (diff) | |
| download | Tango-6e2eeb6829b2b1bf5e1e5334b9dad84f10ce2bc1.tar.gz Tango-6e2eeb6829b2b1bf5e1e5334b9dad84f10ce2bc1.zip | |
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.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs | 50 |
1 files changed, 32 insertions, 18 deletions
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 /// <param name="e">The <see cref="ApplicationCrashedEventArgs"/> instance containing the event data.</param> 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 |
