private string GetCodeOutput(ExecutionResult executionResult) { StringBuilder sb = new StringBuilder(); foreach (string result in executionResult.OutputResults) { sb.Append(result); } return sb.ToString(); }
public ExecutionResult Execute(string script) { this.logger.Debug(string.Format("Executing: {0}", script)); this.console.ClearAllInBuffer(); ScriptResult scriptResult = this.repl.Execute(script); ExecutionResult executionResult = new ExecutionResult() { OutputResultWithColorInformation = this.console.GetAllInBuffer() }; return executionResult; }
private string GetCodeHtmlOutput(ExecutionResult executionResult) { StringBuilder sb = new StringBuilder(); foreach (Tuple<string, ConsoleColor> tuple in executionResult.OutputResultWithColorInformation) { string encoded = HttpUtility.HtmlEncode(tuple.Item1); sb.Append(string.Format("<font style=\"color:{0}\">{1}</font>", tuple.Item2.ToString(), encoded)); } return sb.ToString(); }