Промежуточное.

This commit is contained in:
ElEgEv 2023-10-09 18:14:48 +04:00
parent d001a8e245
commit 5b8fe3a26e
6 changed files with 54 additions and 12 deletions

View File

@ -168,13 +168,17 @@ namespace VisualComponentsLib.Components
}
//проверка заполненности входных значений
bool CheckData(List<string[,]> data)
bool CheckData<T>(List<T> dataList)
{
for (int i = 0; i < data.Count; i++)
foreach(var data in dataList)
{
for (int j = 0; j < data[i].Length; j++)
foreach (var value in data.GetType().GetProperties())
{
if (string.IsNullOrEmpty(data[i][0, j])) return false;
//для простоты проверки приводим значение каждого поля к типу string
if(string.IsNullOrEmpty(value.ToString()))
{
return false;
}
}
}

View File

@ -92,7 +92,7 @@ namespace VisualComponentsLib.Components
docRun.AppendChild(properties);
docRun.AppendChild(new Text(simpleTable.TableName));
docRun.AppendChild(new Text(simpleTable.TableHeader));
header.AppendChild(docRun);

View File

@ -47,7 +47,7 @@ namespace VisualComponentsLib.Components
paragraphFormat.Alignment = ParagraphAlignment.Center;
paragraphFormat.KeepTogether = true;
builder.Writeln(simpleHistogram.FileName);
builder.Writeln(simpleHistogram.FileHeader);
// Добавьте диаграмму с данными по умолчанию. Вы можете указать различные типы и размеры диаграмм.
Shape shape = builder.InsertChart(ChartType.Column, 500, 270);

View File

@ -0,0 +1,38 @@
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> HeightHeaderRow = new();
//высота столбцов
public List<double> HeightSimpleRow = new();
//высота колонок
public List<double> WidthCol = new();
public List<T> DataList;
public SetDataTable(string filePath, string fileHeader, List<double> heightHeaderRow,
List<double> heightSimpleRow, List<double> widthCol, List<T> dataList)
{
FilePath = filePath;
FileHeader = fileHeader;
HeightHeaderRow = heightHeaderRow;
HeightSimpleRow = heightSimpleRow;
WidthCol = widthCol;
DataList = dataList;
}
}
}

View File

@ -11,7 +11,7 @@ namespace VisualComponentsLib.Components.SupportClasses
{
public string FilePath = string.Empty;
public string FileName = string.Empty;
public string FileHeader = string.Empty;
public string HistogramName = string.Empty;
@ -19,10 +19,10 @@ namespace VisualComponentsLib.Components.SupportClasses
public List<DataHistogram> DataList = new();
public SimpleHistogram(string filePath, string fileName, string histogramName, EnumAreaLegend areaLegend, List<DataHistogram> dataList)
public SimpleHistogram(string filePath, string fileHeader, string histogramName, EnumAreaLegend areaLegend, List<DataHistogram> dataList)
{
FilePath = filePath;
FileName = fileName;
FileHeader = fileHeader;
HistogramName = histogramName;
AreaLegend = areaLegend;
DataList = dataList;

View File

@ -10,14 +10,14 @@ namespace VisualComponentsLib.Components.SupportClasses
{
public string FilePath = string.Empty;
public string TableName = string.Empty;
public string TableHeader = string.Empty;
public List<string[,]> DataList = new();
public SimpleTable(string filePath, string tableName, List<string[,]> dataList)
public SimpleTable(string filePath, string tableHeader, List<string[,]> dataList)
{
FilePath = filePath;
TableName = tableName;
TableHeader = tableHeader;
DataList = dataList;
}
}