Combinable Enumerations
[Flags]
public enum SomeFlags
{
NoColor = 0,
Red = 1,
Black = 2,
White = 4,
Yellow = 8
}
[Test]
public void CombinableEnumTests()
{
var r = SomeFlags.Red;
var b = SomeFlags.Black;
var w = SomeFlags.White;
var y = SomeFlags.Yellow;
var rb = r | b;
var wy = w | y;
var rbwy = rb | wy;
rbwy ^= y;
rbwy ^= y;
}
Sunday, March 19, 2017
Subscribe to:
Posts (Atom)
Combinable Enumerations [Flags] public enum SomeFlags { NoColor = 0, Red = 1, ...
-
I'm a full stack .NET developer. If you have any questions, you can send me an email at raghu dot muttana at g mail dot com. Wrote on...
-
When you reload the WPF Datagrid's ItemsSource, the previous SortOrder is not retained. Here is a simple way you can preserve the sort o...
-
Combinable Enumerations [Flags] public enum SomeFlags { NoColor = 0, Red = 1, ...