Files
KOP/KOP/Ivanov_components/Models/TableWithHeaderConfig.cs
2024-09-15 20:16:55 +04:00

28 lines
997 B
C#

namespace Ivanov_components.Models
{
public class TableWithHeaderConfig<T> : DocumentConfig
{
public (int Columns, int Rows) ColumnsRowsDataCount { get; set; }
public List<(int Column, int Row)>? ColumnsRowsWidth { get; init; }
public List<(int ColumnIndex, int RowIndex, string Header, string PropertyName)>? Headers { get; init; }
public List<T>? Data { get; init; }
public string NullReplace { get; set; } = "null";
public void CheckFields()
{
if (Data == null || Data.Count == 0)
{
throw new ArgumentNullException("No data");
}
if (ColumnsRowsWidth is null || ColumnsRowsWidth.Count == 0)
{
throw new ArgumentNullException("Rows width invalid");
}
if (Headers is null || Headers.Count == 0)
{
throw new ArgumentNullException("Header data invalid");
}
}
}
}