Program.cs 846 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. namespace PrimitivesSample
  3. {
  4. static class Program
  5. {
  6. /// <summary>
  7. /// The main entry point for the application.
  8. /// </summary>
  9. static void Main (string[] args)
  10. {
  11. MonoMac.AppKit.NSApplication.Init ();
  12. using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
  13. MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate ();
  14. MonoMac.AppKit.NSApplication.Main (args);
  15. }
  16. }
  17. class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
  18. {
  19. PrimitivesSampleGame game;
  20. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  21. {
  22. game = new PrimitivesSampleGame();
  23. game.Run();
  24. }
  25. public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
  26. {
  27. return true;
  28. }
  29. }
  30. }
  31. }