public static void UnhandledExceptionEventHandler(Exception e, bool fatal = false)
        {
            var window = new ExceptionWindow(e);

            if (fatal)
            {
                window.Header.Content = "ManiaPal has ran into a Fatal Error!";
            }
            window.ShowDialog();
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            // Use TLSv1.2
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            // Force US English
            Thread.CurrentThread.CurrentCulture       = new CultureInfo("en-US");
            CultureInfo.DefaultThreadCurrentCulture   = new CultureInfo("en-US");
            CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");

#if !DEBUG
            // Enable our crash handler if compiled in Release
            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
            {
                ExceptionWindow.UnhandledExceptionEventHandler(e.ExceptionObject as Exception, e.IsTerminating);
            };
#endif

            Args = args;
            var application = new App();
            application.InitializeComponent();
            application.Run();
        }