Esempio n. 1
0
        public void Write(UniversalGrid <T> grid)
        {
            var r = grid.TopLeft.Y - 1;
            var c = -1;

            _textFormatter.WriteStartGrid(grid);

            grid.Render((p, x) =>
            {
                if (p.Y > r)
                {
                    if (r > -1)
                    {
                        _textFormatter.WriteEndRow();
                    }
                    _textFormatter.WriteStartRow(p.Y - grid.TopLeft.Y);
                    c = 0;
                }

                _textFormatter.WriteCell(p, c, x);

                c++;
                r = p.Y;
            });

            if (r > -1)
            {
                _textFormatter.WriteEndRow();
            }

            _textFormatter.WriteEndGrid();
        }