-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dequeue system selection in preparation
- Loading branch information
1 parent
36c9a17
commit 5a259cd
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ButterSTT.Config | ||
{ | ||
public struct EnumConfig<T> | ||
where T : struct, Enum | ||
{ | ||
[JsonPropertyName("options")] | ||
public readonly string[] Options { get; } = Enum.GetNames<T>(); | ||
|
||
[JsonPropertyName("value")] | ||
public string Value { get; set; } = ""; | ||
|
||
[JsonIgnore] | ||
public T EnumValue | ||
{ | ||
readonly get => Enum.Parse<T>(Value, ignoreCase: true); | ||
set => Value = Enum.GetName(value)!; | ||
} | ||
|
||
public EnumConfig(T value) | ||
{ | ||
EnumValue = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace ButterSTT.MessageSystem | ||
{ | ||
public enum DequeueSystems | ||
{ | ||
Scrolling, | ||
Pagination, | ||
} | ||
} |