27 lines
880 B
C#
27 lines
880 B
C#
using MeetTheTeacher.Model;
|
|
|
|
namespace MeetTheTeacher.Export;
|
|
|
|
/// <summary>
|
|
/// Allows to export data of <see cref="ICsvRepresentable"/> type to a file in HTML table syntax.
|
|
/// Be careful: does not create valid HTML page, just a fragment!
|
|
/// </summary>
|
|
/// <inheritdoc cref="FileExporterBase" />
|
|
/// <inheritdoc cref="IDataExporter" />
|
|
public sealed class HtmlDataExporter : FileExporterBase, IDataExporter
|
|
{
|
|
public void Export(IEnumerable<ICsvRepresentable> items, string? fileName)
|
|
{
|
|
// TODO (use a raw string literal with interpolation!)
|
|
}
|
|
|
|
private static string CreateTableRow(IEnumerable<string> values, bool isHeader = false)
|
|
{
|
|
// TODO
|
|
return null!;
|
|
}
|
|
|
|
private static string WrapInTag(string content, string tag) => $"<{tag}>{content}</{tag}>";
|
|
|
|
protected override string FileExtension => ".html";
|
|
}
|