This repository has been archived on 2024-06-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
thesis-src/Examples/ReportGenerator/Models/TableInfo.cs
T
Simon Gruber 9ac01e6b12 checkpoint
2023-11-20 14:26:00 +01:00

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
}