private void _testGameProcess_Exited(object sender, EventArgs e)
{
if (_runningGameWithDebugger)
{
Factory.AGSEditor.Debugger.EngineHasExited();
_runningGameWithDebugger = false;
}
if (TestGameFinished != null)
{
int exitCode = -1;
try
{
// the ExitCode property will throw an exception
// if the process didn't start, in which case
// we use -1 as the exit code
exitCode = _testGameProcess.ExitCode;
}
catch (InvalidOperationException) { }
TestGameFinished(exitCode);
}
_testGameProcess = null;
}