public Process StartApplication(ProcessStart start, out CommandResult result)
{
Command command = new Command (CommandType.CreateProcess, start);
if (!engine_event.WaitOne (WaitTimeout, false))
throw new TargetException (TargetError.NotStopped);
event_queue.Lock ();
engine_event.Reset ();
current_command = command;
event_queue.Signal ();
event_queue.Unlock ();
engine_event.WaitOne ();
if (command.Result is Exception)
throw (Exception) command.Result;
else {
var pair = (KeyValuePair<CommandResult,Process>) command.Result;
result = pair.Key;
return pair.Value;
}
}