public virtual void RenderOnBottom(StringBuilderInterlaced stream, string value) { var rowsOfValue = value.Split(new[] { Environment.NewLine }, StringSplitOptions.None); foreach (var s in rowsOfValue) { if (string.IsNullOrWhiteSpace(s)) { continue; } for (var i = 0; i < Math.Max(1, s.Length / _width); i++) { var line = s.Take(_width - 1).Select(e => e.ToString()).Aggregate((e, f) => e + f); var toEnd = _width - line.Length - 1; stream.Append(VerticalLineSeperator); if (DrawSpace) { stream.Append(" "); } stream.Append(line); for (var f = 0; f < toEnd; f++) { stream.Append(" "); } if (DrawSpace) { stream.Append(" "); } stream.AppendLine(VerticalLineSeperator.ToString()); } } DrawHorizontalLine(stream, LowerLeftBound, LowerRightBound, DrawSpace, HorizontalLineSeperator, _width); }
private void RenderOnBottom(ColloredStringBuilder stream, string value) { stream.Append(VerticalLineSeperator); if (DrawSpace) { stream.Append(" "); } stream.Append(value); var toEnd = _width - value.Length; for (int i = 0; i < toEnd - 1; i++) { stream.Append(" "); } if (DrawSpace) { stream.Append(" "); } stream.AppendLine(VerticalLineSeperator.ToString()); DrawHorizontalLine(stream, LowerLeftBound, LowerRightBound); }