From 30f5a25d16b65c267c2658861c50b50c39877bc4 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 12 Aug 2020 23:45:47 +0300 Subject: Implemented global exception trapper GetLastApplicationCrashFromWindows for PPC/FSE/MS. --- .../MachineStudio/Tango.MachineStudio.UI/App.xaml.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') 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 2ea0ebd38..006b9a361 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -88,6 +88,17 @@ namespace Tango.MachineStudio.UI ApplyEFCacheSettings(); WebRequest.DefaultWebProxy = null; + + GetLastApplicationCrashFromWindows(); + } + + private async void GetLastApplicationCrashFromWindows() + { + var logItem = await exceptionTrapper.GetLastApplicationCrashEventLog(); + if (logItem != null) + { + LogManager.Log(logItem); + } } private void ApplyEFCacheSettings() -- cgit v1.3.1 From 12e3f07f55ec0abe09122fa31dc15f38032716c8 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 13 Aug 2020 18:39:26 +0300 Subject: Set global culture info for FSE and MS. --- Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs | 14 ++++++++++++++ .../MachineStudio/Tango.MachineStudio.UI/App.xaml.cs | 14 ++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') 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 759c2f77d..e0c6de0e1 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs @@ -3,11 +3,13 @@ using System.Collections.Generic; using System.Configuration; using System.Data; using System.Diagnostics; +using System.Globalization; using System.Linq; using System.Net; using System.Threading; using System.Threading.Tasks; using System.Windows; +using System.Windows.Markup; using Tango.Core.DI; using Tango.Core.Helpers; using Tango.FSE.Common; @@ -48,6 +50,18 @@ namespace Tango.FSE.UI protected override void OnStartup(StartupEventArgs e) { + //Set culture info. + var enUSCulture = new CultureInfo("en-US"); + + Thread.CurrentThread.CurrentCulture = enUSCulture; + Thread.CurrentThread.CurrentUICulture = enUSCulture; + CultureInfo.DefaultThreadCurrentCulture = enUSCulture; + CultureInfo.DefaultThreadCurrentUICulture = enUSCulture; + + FrameworkElement.LanguageProperty.OverrideMetadata( + typeof(FrameworkElement), + new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); + ThreadPool.SetMaxThreads(1000, 1000); ThreadsHelper.SetDisptacher(Dispatcher); 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 006b9a361..7eab5066a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -25,6 +25,8 @@ using Tango.Core; using Tango.BL; using Tango.Integration.Operation; using System.Net; +using System.Globalization; +using System.Windows.Markup; namespace Tango.MachineStudio.UI { @@ -40,6 +42,18 @@ namespace Tango.MachineStudio.UI protected override void OnStartup(StartupEventArgs e) { + //Set culture info. + var enUSCulture = new CultureInfo("en-US"); + + Thread.CurrentThread.CurrentCulture = enUSCulture; + Thread.CurrentThread.CurrentUICulture = enUSCulture; + CultureInfo.DefaultThreadCurrentCulture = enUSCulture; + CultureInfo.DefaultThreadCurrentUICulture = enUSCulture; + + FrameworkElement.LanguageProperty.OverrideMetadata( + typeof(FrameworkElement), + new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); + StartupArgs = e.Args; #if DEBUG -- cgit v1.3.1