T
Tim Johnson
Is there an approved .net way to define or-able enums? I'd like to define
enum items with values of 1,2,4,8, etc and be able to OR them together as a
mask as follows:
public enum Tests
{
Test1=1,
Teste2=2,
Test3=4,
Test4=8,
Test5=16
}
Tests teststodo = Test1 | Test3 | Test4;
PerformTests(teststodo);
private void PerformTests(Tests enumMask)
{
}
But in that example "teststodo" does not contain a legitimate enum value
from the predefined list. How do you do that?
--
Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
enum items with values of 1,2,4,8, etc and be able to OR them together as a
mask as follows:
public enum Tests
{
Test1=1,
Teste2=2,
Test3=4,
Test4=8,
Test5=16
}
Tests teststodo = Test1 | Test3 | Test4;
PerformTests(teststodo);
private void PerformTests(Tests enumMask)
{
}
But in that example "teststodo" does not contain a legitimate enum value
from the predefined list. How do you do that?
--
Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625