mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-02 08:09:16 +00:00
27 lines
948 B
C#
27 lines
948 B
C#
using System;
|
|
|
|
namespace DiscordChatExporter.Core.Models
|
|
{
|
|
public static class Extensions
|
|
{
|
|
public static string GetFileExtension(this ExportFormat format) =>
|
|
format switch
|
|
{
|
|
ExportFormat.PlainText => "txt",
|
|
ExportFormat.HtmlDark => "html",
|
|
ExportFormat.HtmlLight => "html",
|
|
ExportFormat.Csv => "csv",
|
|
_ => throw new ArgumentOutOfRangeException(nameof(format))
|
|
};
|
|
|
|
public static string GetDisplayName(this ExportFormat format) =>
|
|
format switch
|
|
{
|
|
ExportFormat.PlainText => "Plain Text",
|
|
ExportFormat.HtmlDark => "HTML (Dark)",
|
|
ExportFormat.HtmlLight => "HTML (Light)",
|
|
ExportFormat.Csv => "Comma Seperated Values (CSV)",
|
|
_ => throw new ArgumentOutOfRangeException(nameof(format))
|
|
};
|
|
}
|
|
} |