DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

37
kicks
published 8 months, 12 days ago, submitted by HoolieMan HoolieMan 8 months, 12 days ago

blog.spontaneouspublicity.com — Do you think the use of an enum in your code is limiting the possible values that can be used? Think again. Maybe we need to learn to be more careful about checking our enums for valid values.

Add a comment 5 comments | category: | Views: 2 | Get KickIt image code
tags: | tag it

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:
I'm 99% sure its this way so that you can logical-OR together enum values and store the result with a variable of the enum's type.
posted by yesthatmcgurk yesthatmcgurk 8 months, 12 days ago
Yeah, the logical-OR scenario seems like the best explanation. It would be nice if they limited this behavior only to enums with the [Flags] attribute just to make things clearer for enums which are not meant to be OR'd together.
posted by HoolieMan HoolieMan 8 months, 12 days ago
Interesting. I smell an FxCop rule coming.
posted by senfo 8 months, 12 days ago
I was googling a bit. Do you know the 'FlagsAttribute' that you can put on top of an enum defenition?
http://msdn2.microsoft.com/en-us/library/system.flagsattribute.aspx
posted by TweeZz TweeZz 8 months, 10 days ago
see the first comment, tweezz.
posted by yesthatmcgurk yesthatmcgurk 7 months, 27 days ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge