ウィンドウが閉じているときにモノマックアプリを終了する方法?

StackOverflow https://stackoverflow.com/questions/6064525

  •  16-11-2019
  •  | 
  •  

質問

- (BOOL)applicationShouldTerminateAfterLastWindowClosed: メソッドを使用してCocoaアプリを終了するアプリケーションのデリゲートのメソッドを使用してウィンドウが閉じます。

モノマックで同じことをすることができますか?一般的に、Objective-CメソッドをMonomacのC#関数にマッピングする方法は?

役に立ちましたか?

解決

I found this code, I see that I can use the same function in the delegate.

namespace AnimatingViews
{
    public partial class AppDelegate : NSApplicationDelegate
    {
        AnimatingViewsWindowController animatingViewsWindowController;

        public AppDelegate ()
        {
        }

        public override void FinishedLaunching (NSObject notification)
        {
            animatingViewsWindowController = new AnimatingViewsWindowController ();
            animatingViewsWindowController.Window.MakeKeyAndOrderFront (this);
        }

        public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
        {
            return true;
        }
    }
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top