Hi
It seams a bit stupid question but I have some problems comparing enums, imagine the following code
enum Actions {
Read,
Write,
Delete,
Query,
Sync
}
Actions actions = Actions.Read | Actions.Write;
Now how can I use the IF statement to see if the (actions) contains the Actions.Read
This code for example is not working
If(actions == Actions.Read)
Is there is any method for contain something like
If(actions contains(Actions.Read))

How can I compare enums?
Sovman
try this:
if((actions & Actions.Read)!= 0)
{
....
}
Gogou
FugersonHall
Heathcliff
if ((action & Actions.Write) == Actions.Write) ...
-Karl Erickson