Example #1
0
        static void Main()
        {
            ErrorHandler = new ErrorHandlerPPD();
            ErrorHandler.Initialize();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                Application.Run(new Form1());
            }
            catch (Exception e)
            {
                ErrorHandler.ProcessError(e);
            }
        }
Example #2
0
        static void Main()
        {
            var errorHandler = new ErrorHandlerPPD();

            errorHandler.Initialize();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            using (MyGame game = new MyGame(new PPDExecuteArg(new string[] { })))
            {
                try
                {
                    game.Run();
                }
                catch (Exception e)
                {
                    errorHandler.ProcessError(e);
                    game.Form.MainForm.Close();
                }
            }
        }
Example #3
0
        static void Main()
        {
            System.Environment.CurrentDirectory = Path.GetDirectoryName(Application.ExecutablePath);
            var errorHandler = new ErrorHandlerPPD();

            errorHandler.Initialize();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Game game = null;

            try
            {
                PPDSetting.Initialize();
                game = new MyGame(new PPDExecuteArg(new string[] { }));
                game.Run();
            }
            catch (Exception e)
            {
                SplashForm.CloseSplash();
                errorHandler.ProcessError(e);
                if (game != null)
                {
                    try
                    {
                        game.Window.RescueData();
                    }
                    catch
                    {
                    }
                    game.Window.Close();
                }
            }
            finally
            {
                if (game != null)
                {
                    game.Dispose();
                    game = null;
                }
            }
        }