pull/236/head
Alexey Golub 5 years ago
parent fa4bb3b693
commit d6980cef8d

@ -4,32 +4,24 @@ namespace DiscordChatExporter.Core.Models
{
public static class Extensions
{
public static string GetFileExtension(this ExportFormat format)
public static string GetFileExtension(this ExportFormat format) =>
format switch
{
if (format == ExportFormat.PlainText)
return "txt";
if (format == ExportFormat.HtmlDark)
return "html";
if (format == ExportFormat.HtmlLight)
return "html";
if (format == ExportFormat.Csv)
return "csv";
ExportFormat.PlainText => "txt",
ExportFormat.HtmlDark => "html",
ExportFormat.HtmlLight => "html",
ExportFormat.Csv => "csv",
_ => throw new ArgumentOutOfRangeException(nameof(format))
};
throw new ArgumentOutOfRangeException(nameof(format));
}
public static string GetDisplayName(this ExportFormat format)
public static string GetDisplayName(this ExportFormat format) =>
format switch
{
if (format == ExportFormat.PlainText)
return "Plain Text";
if (format == ExportFormat.HtmlDark)
return "HTML (Dark)";
if (format == ExportFormat.HtmlLight)
return "HTML (Light)";
if (format == ExportFormat.Csv)
return "Comma Seperated Values (CSV)";
throw new ArgumentOutOfRangeException(nameof(format));
}
ExportFormat.PlainText => "Plain Text",
ExportFormat.HtmlDark => "HTML (Dark)",
ExportFormat.HtmlLight => "HTML (Light)",
ExportFormat.Csv => "Comma Seperated Values (CSV)",
_ => throw new ArgumentOutOfRangeException(nameof(format))
};
}
}
Loading…
Cancel
Save