PIbd-31_Kryukov.A.I._COP_9/COP/KryukovLib/Models/TableWithHeaderConfig.cs
2024-10-06 14:23:43 +04:00

28 lines
959 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KryukovLib.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, string Header, string PropertyName)>? Headers { get; init; }
public List<T>? Data { get; init; }
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");
}
}
}