コード例 #1
0
        public int Run(WindowCore mainWindow = null)
        {
            Action destroyHandler = () => { MessageHelpers.PostQuitMessage(); };

            if (mainWindow != null)
            {
                mainWindow.Destroyed += destroyHandler;
            }
            var res = this.RunCore();

            // Technically, this can be avoided by setting the handler to auto disconnect.
            // However, this helps keep the mainWindow alive, and use this instead of
            // GC.KeepAlive pattern.
            if (mainWindow != null)
            {
                mainWindow.Destroyed -= destroyHandler;
            }
            return(res);
        }
コード例 #2
0
ファイル: Application.cs プロジェクト: G0oDkat/pixel-logic
 public void Exit()
 {
     MessageHelpers.PostQuitMessage();
 }