Program.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. #if MONOMAC
  5. using MonoMac.AppKit;
  6. using MonoMac.Foundation;
  7. #endif
  8. namespace NetworkStateManagement
  9. {
  10. #region Entry Point
  11. #if MONOMAC
  12. static class Program
  13. {
  14. /// <summary>
  15. /// The main entry point for the application.
  16. /// </summary>
  17. static void Main (string[] args)
  18. {
  19. NSApplication.Init ();
  20. using (var p = new NSAutoreleasePool ()) {
  21. NSApplication.SharedApplication.Delegate = new AppDelegate();
  22. NSApplication.Main(args);
  23. }
  24. }
  25. }
  26. class AppDelegate : NSApplicationDelegate
  27. {
  28. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  29. {
  30. using (NetworkStateManagementGame game = new NetworkStateManagementGame ()) {
  31. game.Run ();
  32. }
  33. }
  34. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  35. {
  36. return true;
  37. }
  38. }
  39. #else
  40. static class Program
  41. {
  42. private static NetworkStateManagementGame game;
  43. /// <summary>
  44. /// The main entry point for the application.
  45. /// </summary>
  46. [STAThread]
  47. static void Main()
  48. {
  49. game = new NetworkStateManagementGame();
  50. game.Run();
  51. }
  52. }
  53. #endif
  54. #endregion
  55. }