using System; using Spectre.Console.Rendering; namespace Spectre.Console { /// /// Contains extension methods for . /// public static class TableColumnExtensions { /// /// Sets the table column header. /// /// The table column. /// The table column header markup text. /// The same instance so that multiple calls can be chained. public static TableColumn Header(this TableColumn column, string header) { if (column is null) { throw new ArgumentNullException(nameof(column)); } if (header is null) { throw new ArgumentNullException(nameof(header)); } column.Header = new Markup(header); return column; } /// /// Sets the table column header. /// /// The table column. /// The table column header. /// The same instance so that multiple calls can be chained. public static TableColumn Header(this TableColumn column, IRenderable header) { if (column is null) { throw new ArgumentNullException(nameof(column)); } if (header is null) { throw new ArgumentNullException(nameof(header)); } column.Footer = header; return column; } /// /// Sets the table column footer. /// /// The table column. /// The table column footer markup text. /// The same instance so that multiple calls can be chained. public static TableColumn Footer(this TableColumn column, string footer) { if (column is null) { throw new ArgumentNullException(nameof(column)); } if (footer is null) { throw new ArgumentNullException(nameof(footer)); } column.Footer = new Markup(footer); return column; } /// /// Sets the table column footer. /// /// The table column. /// The table column footer. /// The same instance so that multiple calls can be chained. public static TableColumn Footer(this TableColumn column, IRenderable footer) { if (column is null) { throw new ArgumentNullException(nameof(column)); } if (footer is null) { throw new ArgumentNullException(nameof(footer)); } column.Footer = footer; return column; } } }