I have to build an extension method for each flag type I declare, like so:
public static EventMessageScope SetFlag(this EventMessageScope flags,
EventMe
Enums got borked by the C language a long time ago. Having a modicum of type safety in the C# language was important to the designers, leaving no room for an Enum.SetFlags when the underlying type can be anything between a byte and a long. Another C induced problem btw.
The proper way to deal with it is to write this kind of code inline explicitly and not try to shove it into an extension method. You don't want to write a C macro in the C# language.