Add MkvEditCommand
This commit is contained in:
13
MkvToolnixWrapper/Shared/MkvExtensions.cs
Normal file
13
MkvToolnixWrapper/Shared/MkvExtensions.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace MkvPropEditWrapper.Shared;
|
||||
|
||||
public static class MkvExtensions
|
||||
{
|
||||
public static bool FromFlagBoolean(this string value) => value switch
|
||||
{
|
||||
"1" => true,
|
||||
"0" => false,
|
||||
_ => throw new ArgumentException("Value must be '0' or '1'", nameof(value))
|
||||
};
|
||||
|
||||
public static string ToFlagBoolean(this bool value) => value ? "1" : "0";
|
||||
}
|
||||
Reference in New Issue
Block a user