private string Describe(IRecordedCommand cmd) { var replay = new ReplayBuffer(50); replay.Wrap(string.Format("Command type: {0}", cmd.GetType().Name)); replay.NewLine(); replay.NewLine(); cmd.Replay(replay); var output = replay.ToLines().JoinWith(Environment.NewLine); Console.WriteLine(output); return output; }
public void Replay(ReplayBuffer buffer) { if (buffer.CursorLeft > 0) buffer.NewLine(); int wrappedLines; var lines = _data.Render(buffer.Width, out wrappedLines).ToList(); if (lines.Count == 0) return; foreach (var line in lines.Where((l, i) => i < lines.Count - 1)) { buffer.Write(line); buffer.NewLine(); } buffer.Write(lines.Last()); }