12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #region Using Statements
- using System;
- #if IPHONE
- using MonoTouch.Foundation;
- using MonoTouch.UIKit;
- using Microsoft.Xna;
- using Microsoft.Xna.Framework.Media;
- #elif MONOMAC
- #endif
- #endregion
- namespace GameStateManagement
- {
- #region Entry Point
- #if IPHONE
- [Register("AppDelegate")]
- class Program : UIApplicationDelegate
- {
- GameStateManagementGame game;
- public override void FinishedLaunching(UIApplication app)
- {
- // Fun begins..
- game = new GameStateManagementGame();
- game.Run();
- }
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- static void Main(string[] args)
- {
- UIApplication.Main(args, null, "AppDelegate");
- }
- }
- #elif MONOMAC
- static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- static void Main (string[] args)
- {
- MonoMac.AppKit.NSApplication.Init ();
-
- using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
- MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate();
- MonoMac.AppKit.NSApplication.Main(args);
- }
- }
- }
-
- class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
- {
- public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
- {
- var game = new GameStateManagementGame();
- game.Run();
- }
-
- public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
- {
- return true;
- }
- }
- #else
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- static class Program
- {
- static void Main()
- {
- using (GameStateManagementGame game = new GameStateManagementGame())
- {
- game.Run();
- }
- }
- }
- #endif
- #endregion
- }
|