X-Git-Url: https://git.r.bdr.sh/rbdr/super-polarity/blobdiff_plain/4fc09567c557a1110180940cca40fd7144921026..8ae8ea0d77ec654dd693b3912562b07a2b539b0f:/SuperPolarityMac/Program.cs diff --git a/SuperPolarityMac/Program.cs b/SuperPolarityMac/Program.cs index 6c3f614..5c7bbbc 100644 --- a/SuperPolarityMac/Program.cs +++ b/SuperPolarityMac/Program.cs @@ -1,26 +1,45 @@ -#region Using Statements -using System; -using System.Collections.Generic; -using System.Linq; -#endregion +using AppKit; +using Foundation; namespace SuperPolarity { -#if WINDOWS || LINUX - /// - /// The main class. - /// - public static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - using (var superPolarity = new SuperPolarity()) - superPolarity.Run(); - } - } -#endif + [Register ("AppDelegate")] + static class Program + { + /// + /// The main entry point for the application. + /// + 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) + { + } + } } + +