In case others run into this problem and find this article, the solution I went with was to add an extra member of the listing to each of my listings.
enum UserRequests : byte
{
Burp = 0,
Sneeze = 1,
Fart = 2,
/* Maximum Valid Value */
MAXVAL = Fart
}
This is a practice that I remember using in C ((not ANSI) C # defines) to iterate over enumeration values, its only drawback is that it is difficult to maintain.
, (, ); MAXVAL, , . , , .
public static bool TryParseByteToEnum<T>(byte input_byte,
out T enum_member, T max_value) where
T : struct, IConvertible