Files
mixtape/zero.Core/Utils/TableBuilder/TableColumn.cs
T

56 lines
948 B
C#
Raw Normal View History

2020-10-07 16:08:09 +02:00
using System;
namespace zero.Core.Utils
{
public class TableColumn<T>
{
public string Name { get; set; }
public bool IsSeparator { get; set; }
public Func<T, object> FieldSelector { get; set; }
public double Width { get; set; }
public TableColumnType ColumnType { get; set; }
public TableColumn<T> Type(TableColumnType type)
{
ColumnType = type;
return this;
}
public TableColumn<T> Size(double width)
{
Width = width;
return this;
}
public TableColumn<T> For(Func<T, object> fieldSelector)
{
FieldSelector = fieldSelector;
return this;
}
public TableColumn<T> Currency()
{
ColumnType = TableColumnType.Currency;
return this;
}
public TableColumn<T> Link()
{
ColumnType = TableColumnType.Link;
return this;
}
}
public enum TableColumnType
{
Default,
Currency,
Link
}
}