mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 17:02:51 +08:00
Add new ctors for Rows
and Columns
widgets
This commit is contained in:
parent
0b4359a52a
commit
70fc14e9cd
@ -25,7 +25,16 @@ namespace Spectre.Console
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Columns"/> class.
|
/// Initializes a new instance of the <see cref="Columns"/> class.
|
||||||
/// </summary>
|
/// </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)
|
public Columns(IEnumerable<IRenderable> items)
|
||||||
{
|
{
|
||||||
if (items is null)
|
if (items is null)
|
||||||
|
@ -19,7 +19,16 @@ namespace Spectre.Console
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Rows"/> class.
|
/// Initializes a new instance of the <see cref="Rows"/> class.
|
||||||
/// </summary>
|
/// </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)
|
public Rows(IEnumerable<IRenderable> children)
|
||||||
{
|
{
|
||||||
_children = new List<IRenderable>(children ?? throw new ArgumentNullException(nameof(children)));
|
_children = new List<IRenderable>(children ?? throw new ArgumentNullException(nameof(children)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user