mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-28 21:54:11 -04:00
Cleanup
This commit is contained in:
parent
fa4bb3b693
commit
d6980cef8d
1 changed files with 18 additions and 26 deletions
|
@ -4,32 +4,24 @@ namespace DiscordChatExporter.Core.Models
|
||||||
{
|
{
|
||||||
public static class Extensions
|
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";
|
ExportFormat.PlainText => "txt",
|
||||||
if (format == ExportFormat.HtmlDark)
|
ExportFormat.HtmlDark => "html",
|
||||||
return "html";
|
ExportFormat.HtmlLight => "html",
|
||||||
if (format == ExportFormat.HtmlLight)
|
ExportFormat.Csv => "csv",
|
||||||
return "html";
|
_ => throw new ArgumentOutOfRangeException(nameof(format))
|
||||||
if (format == ExportFormat.Csv)
|
};
|
||||||
return "csv";
|
|
||||||
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(format));
|
public static string GetDisplayName(this ExportFormat format) =>
|
||||||
}
|
format switch
|
||||||
|
{
|
||||||
public static string GetDisplayName(this ExportFormat format)
|
ExportFormat.PlainText => "Plain Text",
|
||||||
{
|
ExportFormat.HtmlDark => "HTML (Dark)",
|
||||||
if (format == ExportFormat.PlainText)
|
ExportFormat.HtmlLight => "HTML (Light)",
|
||||||
return "Plain Text";
|
ExportFormat.Csv => "Comma Seperated Values (CSV)",
|
||||||
if (format == ExportFormat.HtmlDark)
|
_ => throw new ArgumentOutOfRangeException(nameof(format))
|
||||||
return "HTML (Dark)";
|
};
|
||||||
if (format == ExportFormat.HtmlLight)
|
|
||||||
return "HTML (Light)";
|
|
||||||
if (format == ExportFormat.Csv)
|
|
||||||
return "Comma Seperated Values (CSV)";
|
|
||||||
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(format));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue