private bool _mainForm_OnEditorShutdown()
{
SaveEditorWindowSizeToRegistry();
bool canShutDown = true;
if (_batchProcessShutdown)
{
if (OnEditorShutdown != null)
{
OnEditorShutdown();
}
}
else if (!_exitFromWelcomeScreen)
{
canShutDown = QueryWhetherToSaveGameBeforeContinuing("Do you want to save the game before exiting?");
if (canShutDown)
{
if (QueryEditorShutdown != null)
{
canShutDown = QueryEditorShutdown();
}
if ((canShutDown) && (OnEditorShutdown != null))
{
OnEditorShutdown();
}
}
}
if (canShutDown)
{
SystemEvents.DisplaySettingsChanged -= new EventHandler(SystemEvents_DisplaySettingsChanging);
_agsEditor.Dispose();
}
return canShutDown;
}