-#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
+ [Register ("AppDelegate")]
+ 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 AppDelegate ()
+ {
+ }
+
+ public override void DidFinishLaunching (NSNotification notification)
+ {
+ superPolarity = new SuperPolarity();
+ superPolarity.Run ();
+ }
+
+ public override void WillTerminate (NSNotification notification)
+ {
+ }
+ }