C# Fundamentals: Combining Enum Values with Bit-Flags(geekswithblogs.net)

submitted by mopenmopen(3596) 1 year, 10 months ago

You may notice we decorated our enum with a [Flags] attribute. You may also notice we skipped the value of 3 in our enumeration, we’ll get to each of these points in turn in the sections that follow, for now take it on faith that these steps are best practices and you'll soon see the reason. So now, this definition of a [Flags] enum will allow us to have a MessagingProperties value that is both Durable and Persistent, or is both Buffered and Durable, or is all three, or is none of the three, and so on and so on. But how would we represent this in code?

add a comment |category: |Views: 51

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story