Value points were added

This commit is contained in:
Evgeny Redikultsev
2024-03-02 21:40:13 +05:00
parent 2e8ebccc13
commit 4359b2c49b
41 changed files with 1127 additions and 439 deletions

View File

@@ -7,10 +7,12 @@ using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Parameters
{
public class ArrayParameter<T> : IArrayParameter<T>
/// <inheritdoc/>
public class ArrayParameter<T> : IArrayParameter<T>
{
private string[] columnLabels;
public string[] ColumnLabels
private List<string> columnLabels;
/// <inheritdoc/>
public List<string> ColumnLabels
{
get { return columnLabels; }
set
@@ -25,12 +27,20 @@ namespace StructureHelperCommon.Models.Parameters
}
}
/// <inheritdoc/>
public T[,] Data { get; private set; }
public ArrayParameter(int rowCount, int columnCount, string[] columnLabels = null)
public ArrayParameter(int rowCount, int columnCount, List<string> columnLabels = null)
{
Data = new T[rowCount, columnCount];
if (columnLabels is not null) { ColumnLabels = columnLabels; }
if (columnLabels is not null)
{
if (columnLabels.Count > columnCount)
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": Count of column labels is greater than count of columns");
}
ColumnLabels = columnLabels;
}
}
}
}

View File

@@ -6,9 +6,19 @@ using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Parameters
{
/// <summary>
/// Rectangle table of parameters
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IArrayParameter<T>
{
/// <summary>
/// Data of rectangle table
/// </summary>
T[,] Data { get; }
string[] ColumnLabels { get; set; }
/// <summary>
/// Collection of headers of table
/// </summary>
List<string> ColumnLabels { get; set; }
}
}