static Register ToRegister(string value) { if (value == string.Empty) { return(Register.None); } if (!ToEnumConverter.TryRegister(value, out var reg)) { throw new InvalidOperationException($"Invalid Register value: '{value}'"); } return(reg); }