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

            if (fatal)
            {
                window.Header.Content = "ScriptDatabaseEditor has ran into a Fatal Error!";
            }
            window.ShowDialog();
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            // For Debugging
            Args = args;
            // Language
            CultureInfo.DefaultThreadCurrentCulture   = new CultureInfo("en-US");
            CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");
#if !DEBUG
            // Enable our crash window if compiled in Release
            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
            {
                ExceptionWindow.UnhandledExceptionEventHandler(e.ExceptionObject as Exception, e.IsTerminating);
            };
#endif

            if (args.Length > 0)
            {
                DataBasePath = args[0];
            }
            var application = new App();
            application.InitializeComponent();
            application.ShutdownMode = ShutdownMode.OnMainWindowClose;
            application.Run(application.MainWindow);
        }