Промежуточное.
This commit is contained in:
parent
d001a8e245
commit
5b8fe3a26e
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ namespace VisualComponentsLib.Components
|
|||||||
|
|
||||||
docRun.AppendChild(properties);
|
docRun.AppendChild(properties);
|
||||||
|
|
||||||
docRun.AppendChild(new Text(simpleTable.TableName));
|
docRun.AppendChild(new Text(simpleTable.TableHeader));
|
||||||
|
|
||||||
header.AppendChild(docRun);
|
header.AppendChild(docRun);
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ namespace VisualComponentsLib.Components
|
|||||||
paragraphFormat.Alignment = ParagraphAlignment.Center;
|
paragraphFormat.Alignment = ParagraphAlignment.Center;
|
||||||
paragraphFormat.KeepTogether = true;
|
paragraphFormat.KeepTogether = true;
|
||||||
|
|
||||||
builder.Writeln(simpleHistogram.FileName);
|
builder.Writeln(simpleHistogram.FileHeader);
|
||||||
|
|
||||||
// Добавьте диаграмму с данными по умолчанию. Вы можете указать различные типы и размеры диаграмм.
|
// Добавьте диаграмму с данными по умолчанию. Вы можете указать различные типы и размеры диаграмм.
|
||||||
Shape shape = builder.InsertChart(ChartType.Column, 500, 270);
|
Shape shape = builder.InsertChart(ChartType.Column, 500, 270);
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -11,7 +11,7 @@ namespace VisualComponentsLib.Components.SupportClasses
|
|||||||
{
|
{
|
||||||
public string FilePath = string.Empty;
|
public string FilePath = string.Empty;
|
||||||
|
|
||||||
public string FileName = string.Empty;
|
public string FileHeader = string.Empty;
|
||||||
|
|
||||||
public string HistogramName = string.Empty;
|
public string HistogramName = string.Empty;
|
||||||
|
|
||||||
@ -19,10 +19,10 @@ namespace VisualComponentsLib.Components.SupportClasses
|
|||||||
|
|
||||||
public List<DataHistogram> DataList = new();
|
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;
|
FilePath = filePath;
|
||||||
FileName = fileName;
|
FileHeader = fileHeader;
|
||||||
HistogramName = histogramName;
|
HistogramName = histogramName;
|
||||||
AreaLegend = areaLegend;
|
AreaLegend = areaLegend;
|
||||||
DataList = dataList;
|
DataList = dataList;
|
||||||
|
@ -10,14 +10,14 @@ namespace VisualComponentsLib.Components.SupportClasses
|
|||||||
{
|
{
|
||||||
public string FilePath = string.Empty;
|
public string FilePath = string.Empty;
|
||||||
|
|
||||||
public string TableName = string.Empty;
|
public string TableHeader = string.Empty;
|
||||||
|
|
||||||
public List<string[,]> DataList = new();
|
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;
|
FilePath = filePath;
|
||||||
TableName = tableName;
|
TableHeader = tableHeader;
|
||||||
DataList = dataList;
|
DataList = dataList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user