/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Instance instance = new Instance()) { try { instance.Run(); } catch (Exception e) { if (EntityIoLogger.FatalExceptionCaught) { DefaultLogger.WriteExceptionThenQuit(MessageType.UncaughtRuntimeException, e, "Caught in main program.cs"); DefaultLogger.Close(); instance.Exit(); } } } }
/// <summary> /// Event handler for the game exiting. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> protected override void OnExiting(object sender, System.EventArgs args) { DefaultLogger.Write(MessageType.Information, "Shutting engine down normally ....", 1); DefaultLogger.Close(); base.OnExiting(sender, args); }