예제 #1
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)
            {
                ScriptPath = args[0];
            }
            if (args.Length > 1)
            {
                if (args[1] == "pbb")
                {
                    WorkingGame = Game.PsychedelicaOfTheBlackButterfly;
                }
            }
            var application = new App();
            application.InitializeComponent();
            application.ShutdownMode = ShutdownMode.OnMainWindowClose;
            application.Run(application.MainWindow);
        }
예제 #2
0
        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();
        }