1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-01-15 14:42:46 +01:00
TweetDuck/lib/TweetLib.Core/Features/Plugins/Enums/PluginGroup.cs
2022-02-05 23:34:00 +01:00

33 lines
811 B
C#

using System;
using System.Collections.Generic;
namespace TweetLib.Core.Features.Plugins.Enums {
public enum PluginGroup {
Official,
Custom
}
static class PluginGroups {
public static IEnumerable<PluginGroup> All { get; } = new PluginGroup[] {
PluginGroup.Official,
PluginGroup.Custom
};
public static string GetSubFolder(this PluginGroup group) {
return group switch {
PluginGroup.Official => "official",
PluginGroup.Custom => "user",
_ => throw new InvalidOperationException($"Invalid plugin group: {group}")
};
}
public static string GetIdentifierPrefix(this PluginGroup group) {
return group switch {
PluginGroup.Official => "official/",
PluginGroup.Custom => "custom/",
_ => "unknown/"
};
}
}
}