using System;
namespace Spectre.Console
{
///
/// Contains extension methods for .
///
public static class ColumnExtensions
{
///
/// Prevents a column from wrapping.
///
/// An object implementing .
/// The column.
/// The same instance so that multiple calls can be chained.
public static T NoWrap(this T obj)
where T : class, IColumn
{
if (obj is null)
{
throw new ArgumentNullException(nameof(obj));
}
obj.NoWrap = true;
return obj;
}
///
/// Sets the width of the column.
///
/// An object implementing .
/// The column.
/// The column width.
/// The same instance so that multiple calls can be chained.
public static T Width(this T obj, int? width)
where T : class, IColumn
{
if (obj is null)
{
throw new ArgumentNullException(nameof(obj));
}
obj.Width = width;
return obj;
}
}
}