コード例 #1
0
        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;
        }
コード例 #2
0
        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());
        }
コード例 #3
0
 public void SetUp()
 {
     _buffer = new ReplayBuffer(TestBufferWidth);
 }