I have a enum like
enum Test
{
A = -2,
B = -1 ,
C = 0 ,
D = 1 ,
E = 2
}
and , how can i judge a enum value is in a combine enum values
class Program
{
static void Main(string[] args)
{
Test t1 = Test.A | Test.E;
Console.WriteLine((t1 & Test.E) > 0); // true
Console.WriteLine((t1 & Test.A) > 0); // why this is false ?
Console.ReadKey();
}
}
i want to ask about , why
Test t1 = Test.A | Test.E;
but
Console.WriteLine((t1 & Test.A) > 0);
Thanks....
UPDATE:
Thank you for your comment , and the good design...
*I think I will change the bad design as sonn as quickly!! *
*Thank you all the same . (^^ メ)*