49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
namespace ReportGenerator.Models;
|
|
|
|
internal readonly struct TableInfo
|
|
{
|
|
public IEnumerable<IEnumerable<string>> Rows { get; } = Enumerable.Empty<IEnumerable<string>>();
|
|
|
|
public string Title { get; init; } = string.Empty;
|
|
|
|
public string RowStart { get; init; } = string.Empty;
|
|
public string RowEnd { get; init; } = string.Empty;
|
|
|
|
public string ColumnStart { get; init; } = string.Empty;
|
|
public string ColumnEnd { get; init; } = string.Empty;
|
|
|
|
public TableInfo(IEnumerable<IEnumerable<string>> rows)
|
|
{
|
|
Rows = rows;
|
|
}
|
|
|
|
#region Overrides of ValueType
|
|
|
|
/// <inheritdoc />
|
|
public override string ToString()
|
|
{
|
|
string result = string.Empty;
|
|
|
|
// Title
|
|
result += Title;
|
|
|
|
// Body
|
|
foreach (var row in Rows)
|
|
{
|
|
result += RowStart;
|
|
|
|
foreach (var column in row)
|
|
{
|
|
result += ColumnStart;
|
|
result += column;
|
|
result += ColumnEnd;
|
|
}
|
|
|
|
result += RowEnd;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
#endregion
|
|
} |