Creating user friendly strings for enum values(ytechie.com)

submitted by SuperJasonSuperJason(2740) 4 years ago

I’ll show you how to create a custom attribute for enum values to assign extra information to an enum. In this case, we’ll be associating a user friendly display name.

1 comment |category: |Views: 61

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:

posted by johnrummelljohnrummell(1321) 4 years ago 0

Interesting. I've been using Phil Haack's approach: http://haacked.com/archive/2005/09/24/10334.aspx. It turns camel cased enum values into capitalized phrases.

Reply

information Login or create an account to comment on this story