mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-30 20:35:48 +08:00
Add row and column accessors for tables and grids
This commit is contained in:
committed by
Patrik Svensson
parent
3e5e22d6c2
commit
e7f497050c
@@ -96,5 +96,37 @@ namespace Spectre.Console
|
||||
calendar.HeaderStyle = style ?? Style.Plain;
|
||||
return calendar;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the calendar header.
|
||||
/// </summary>
|
||||
/// <param name="calendar">The calendar.</param>
|
||||
/// <returns>The same instance so that multiple calls can be chained.</returns>
|
||||
public static Calendar ShowHeader(this Calendar calendar)
|
||||
{
|
||||
if (calendar is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(calendar));
|
||||
}
|
||||
|
||||
calendar.ShowHeader = true;
|
||||
return calendar;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hides the calendar header.
|
||||
/// </summary>
|
||||
/// <param name="calendar">The calendar.</param>
|
||||
/// <returns>The same instance so that multiple calls can be chained.</returns>
|
||||
public static Calendar HideHeader(this Calendar calendar)
|
||||
{
|
||||
if (calendar is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(calendar));
|
||||
}
|
||||
|
||||
calendar.ShowHeader = false;
|
||||
return calendar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user