48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using DocumentFormat.OpenXml.Wordprocessing;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using VisualComponentsLib.Components.SupportClasses.Enums;
|
|
|
|
namespace VisualComponentsLib.Components.SupportClasses
|
|
{
|
|
public class SetDataTable<T>
|
|
{
|
|
public string FilePath = string.Empty;
|
|
|
|
public string FileHeader = string.Empty;
|
|
|
|
//высота столбцов
|
|
public List<double> HeightRow = new();
|
|
|
|
//высота колонок
|
|
public List<double> WidthCol = new();
|
|
|
|
public List<T> DataList;
|
|
|
|
//настройки соответствия столбец-поле
|
|
public Dictionary<int, ColumnName> ColumnsSettings;
|
|
|
|
public SetDataTable(string filePath, string fileHeader, List<double> heightRow,
|
|
List<double> widthCol, List<T> dataList, Dictionary<int, ColumnName> columnsSettings)
|
|
{
|
|
FilePath = filePath;
|
|
FileHeader = fileHeader;
|
|
HeightRow = heightRow;
|
|
WidthCol = widthCol;
|
|
DataList = dataList;
|
|
ColumnsSettings = columnsSettings;
|
|
}
|
|
|
|
////группировка элементов списка по первому полю
|
|
//private static List<T> GroupValue<T>(List<T> data)
|
|
//{
|
|
// var mainField = data[0].GetType().GetProperties().First().Name;
|
|
|
|
// return data.GroupBy(field => field.GetType().GetProperties().First().Name).Select(field => field.ToList());
|
|
//}
|
|
}
|
|
}
|