Needs clarification on C# Flags

Posted by Jojo on Stack Overflow See other posts from Stack Overflow or by Jojo
Published on 2010-04-16T02:31:43Z Indexed on 2010/04/16 2:33 UTC
Read the original article Hit count: 287

Filed under:
|

Hi guys, i have this code:

[Flags]
public enum MyUriType {
ForParse,
ForDownload,
Unknown
}

and then:

MyUriType uriType = MyUriType.ForDownload;

but, I was wondering why this returns true:

if ((uriType & MyUriType.ForParse) == MyUriType.ForParse)

When it is not set in the second code group. Please advise.

© Stack Overflow or respective owner

Related posts about c#

Related posts about flags