public static BeeRunResult Run(string arguments, DirectoryInfo workingDirectory, BuildProgress progress = null) { var command = new StringBuilder(); var output = new StringBuilder(); var beeProgressInfo = Run(arguments, command, output, workingDirectory); while (beeProgressInfo.MoveNext()) { if (progress?.Update(beeProgressInfo.Current.Info, beeProgressInfo.Current.Progress) ?? false) { beeProgressInfo.Current.Process?.Process?.Kill(); return(new BeeRunResult(-1, command.ToString(), "Build was cancelled.")); } } return(new BeeRunResult(beeProgressInfo.Current.ExitCode, command.ToString(), output.ToString())); }