I understand it\'s possible to use bitmasks in enum values, but I don\'t know how to create it.
I have a simple enum :
enum State
{
minimizing = 0,
You can get this effect by specifying all fields in the enum and increased in powers of two to get the bitmask effect. For example, in your case:
enum State
{
minimizing = 1,
maximizing = 2,
minimized = 4,
maximized = 8
};
So you can then have your combinations of (State.maximized | State.minimizing)
. However this won't apply the restriction of only being State.maximized
or State.minimized
. If you want to do that you could convert them to a single bit, but I imagine in this example you would want to be able to have a case where it is neither maximized nor minimized.