void NotifyRedirectedOutput(Action<Action<RemoteTask>> notify, object maybeHasCapturedOutput)
{
var capture = maybeHasCapturedOutput.GetFieldOrPropertyValue("CapturedOutput");
if (capture == null)
{
// Info doesn't have captured output, nothing to report.
return;
}
var stdOutWithStdErrorAndDebugTrace = capture as string;
if (stdOutWithStdErrorAndDebugTrace == null)
{
return;
}
notify(task => _server.TaskOutput(task, stdOutWithStdErrorAndDebugTrace, TaskOutputType.STDOUT));
}