public static bool Terminate(bool byUser) { bool cancel = false; // ... // Did we cancel it? Return false. if (cancel) { return(false); } // Otherwise, actually start terminating. // From this point on, there's no return - need to re-init the editor afterwards. if (Terminating != null) { Terminating(null, EventArgs.Empty); } // Unregister events mainWindow.Activated -= mainWindow_Activated; mainWindow.Deactivate -= mainWindow_Deactivate; Scene.Leaving -= Scene_Leaving; Scene.Entered -= Scene_Entered; Application.Idle -= Application_Idle; // Shut down the editor backend DualityApp.ShutdownBackend(ref graphicsBack); // Shut down the plugin manager pluginManager.Terminate(); // Terminate Duality DualityApp.Terminate(); return(true); }
private static void OnDualityAppTerminating(object sender, EventArgs e) { DualityApp.Terminating -= OnDualityAppTerminating; DualityApp.ShutdownBackend(ref prefBack); }