Program.MacOS.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // Program.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using System.IO;
  12. using MonoMac.Foundation;
  13. using MonoMac.AppKit;
  14. #endregion
  15. namespace Blackjack
  16. {
  17. class Program
  18. {
  19. static void Main (string[] args)
  20. {
  21. NSApplication.Init ();
  22. using (var p = new NSAutoreleasePool ())
  23. {
  24. NSApplication.SharedApplication.Delegate = new AppDelegate();
  25. // Check for Receipt
  26. // if (File.Exists(NSBundle.MainBundle.ResourcePath+"/../_MASReceipt/receipt"))
  27. {
  28. // Work out Hash
  29. NSApplication.Main (args);
  30. }
  31. /*else
  32. {
  33. // Exit with code 173 tp be prompted for another purchase.
  34. }*/
  35. }
  36. }
  37. }
  38. class AppDelegate : NSApplicationDelegate
  39. {
  40. private BlackjackGame game;
  41. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  42. {
  43. game = new BlackjackGame();
  44. game.Run ();
  45. }
  46. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  47. {
  48. return true;
  49. }
  50. }
  51. }