public override bool Init(string environmentCommandLine) { Instance = this; base.Init(environmentCommandLine); SplashWindow = new WindowSplashController(); SplashWindow.Window.MakeKeyAndOrderFront(AppDelegate); Engine = new Engine(environmentCommandLine); Engine.UiManager.Add(this); Engine.TerminateEvent += delegate() { new NSObject().InvokeOnMainThread(() => // BeginInvokeOnMainThread { if (MainWindow != null) { MainWindow.Close(); } if (SplashWindow != null) { SplashWindow.Close(); } //NSApplication.SharedApplication.ReplyToApplicationShouldTerminate (true); NSApplication.SharedApplication.Terminate(new NSObject()); }); }; Engine.Start(); return(true); }
public override void OnDeInit2() { base.OnDeInit2(); if (MainWindow != null) { new NSObject().InvokeOnMainThread(() => { MainWindow.Close(); MainWindow = null; // 2.10.2 }); } }