-#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
-#endregion
+using MonoMac.AppKit;
+using MonoMac.Foundation;
namespace SuperPolarity
{
-#if WINDOWS || LINUX
- /// <summary>
- /// The main class.
- /// </summary>
- public static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- using (var superPolarity = new SuperPolarity())
- superPolarity.Run();
- }
- }
-#endif
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ static void Main (string[] args)
+ {
+ NSApplication.Init ();
+
+ using (var p = new NSAutoreleasePool ()) {
+ NSApplication.SharedApplication.Delegate = new AppDelegate ();
+ NSApplication.Main (args);
+ }
+
+
+ }
+ }
+
+ class AppDelegate : NSApplicationDelegate
+ {
+ SuperPolarity superPolarity;
+
+ public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
+ {
+ superPolarity = new SuperPolarity();
+ superPolarity.Run ();
+ }
+
+ public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
+ {
+ return true;
+ }
+ }
}
+
+