static DecoderOptions ToDecoderOptions(string value) { if (!ToEnumConverter.TryDecoderOptions(value, out var code)) { throw new InvalidOperationException($"Invalid DecoderOptions value: '{value}'"); } return(code); }
static bool TryParseDecoderOptions(string[] stringOptions, ref DecoderOptions options) { foreach (var opt in stringOptions) { if (!ToEnumConverter.TryDecoderOptions(opt.Trim(), out var decOpts)) { return(false); } options |= decOpts; } return(true); }