Add new ctors for Rows and Columns widgets

This commit is contained in:
Patrik Svensson 2020-10-19 20:34:46 +02:00 committed by Patrik Svensson
parent 0b4359a52a
commit 70fc14e9cd
2 changed files with 20 additions and 2 deletions

View File

@ -25,7 +25,16 @@ namespace Spectre.Console
/// <summary>
/// Initializes a new instance of the <see cref="Columns"/> class.
/// </summary>
/// <param name="items">The items to render.</param>
/// <param name="items">The items to render as columns.</param>
public Columns(params IRenderable[] items)
: this((IEnumerable<IRenderable>)items)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Columns"/> class.
/// </summary>
/// <param name="items">The items to render as columns.</param>
public Columns(IEnumerable<IRenderable> items)
{
if (items is null)

View File

@ -19,7 +19,16 @@ namespace Spectre.Console
/// <summary>
/// Initializes a new instance of the <see cref="Rows"/> class.
/// </summary>
/// <param name="children">The children to render.</param>
/// <param name="items">The items to render as rows.</param>
public Rows(params IRenderable[] items)
: this((IEnumerable<IRenderable>)items)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Rows"/> class.
/// </summary>
/// <param name="children">The items to render as rows.</param>
public Rows(IEnumerable<IRenderable> children)
{
_children = new List<IRenderable>(children ?? throw new ArgumentNullException(nameof(children)));