Stories recently tagged with 'Enum'

DateTime formatting extension method(weblogs.asp.net)

submitted by thangchungthangchung(204) 1 year, 3 months ago

In current project, I get some troubles in DateTime class, about format the date time object with the pattern specific string and the current culture, so I decide to code some extension methods in DataTime class in .NET library. And I think it’s it very useful if somebody can use it as right way. I take some idea from this link and coding the enum class for its. After that I also used the Lambda Expression for... read more...

1 comment |category: |Views: 250

tags: another

Design Guidelines Update: Enum Design(blogs.msdn.com)

submitted by johnrummelljohnrummell(1296) 2 years, 9 months ago

This is an older post, but still valid today. "This is a recent update to the Design Guidelines. One of the most interesting additions is the section about adding values to enums (at the end of the section). This was one of the guidelines were getting an agreement across the whole company was quite challenging. Kit (frequent poster to the BCL Team Blog) spent days getting consensus for the guideline." read more...

add a comment |category: |Views: 25

tags: another

C#: Enhance Enums using Extension Methods(pietschsoft.com)

submitted by crpietschmanncrpietschmann(11.3k) 3 years, 6 months ago

Extension Methods are one of the coolest features that have been added in .NET 3.5. I've heard arguments that there is no reason to use them, and the only reason Microsoft added them is to enable the ability to buid LINQ. Well, I do not entirely agree with that statement; in fact, I have found a cool way to use Extension Methods to enhance the System.Enum object since it cannot be inherited. Even though Enum can not be inherited, it can be extended using Extension Methods. Here's the code to an Extension Method that extends the LocalizationMarket Enum with the ToDescriptionString() method that returns the DescriptionAttributes value for the given enum value. read more...

3 comments |category: |Views: 662

tags: another

Data Binding an Enum with Descriptions(xml.indelv.com)

submitted by j.montyj.monty(1868) 3 years, 10 months ago

Finally a SIMPLE, straight-forward, well thought out way to do DataBinding with an Enum. read more...

add a comment |category: |Views: 32

tags: another

Validate integer value before casting it to an Enum type(dotnettipoftheday.org)

submitted by manovichmanovich(755) 4 years, 4 months ago

There is one thing you should watch out for when using enumerations. You can cast any integer to an Enum type and you will not get an exception message. read more...

add a comment |category: |Views: 15

tags: another

Generic Enum Parsing with Extension Methods(geekswithblogs.net)

submitted by usshermussherm(5285) 4 years, 4 months ago

A nice use of the .net 3.5 Extension Methods feature that allows you to easily parse a string and get back the Enum value. read more...

1 comment |category: |Views: 83

tags: another

A strongly-typed combobox control for enum values(kirillosenkov.blogspot.com)

submitted by KirillOsenkovKirillOsenkov(570) 4 years, 4 months ago

... or why do we need the "where T: enum" generic constraint. Kirill Osenkov posts a working sample of a combobox for choosing a value from enum's available values. It is automatically filled with values of the enumeration and has a strongly typed Value property. read more...

add a comment |category: |Views: 148

tags: another

My new little friend, Enum<T>(devlicious.com)

submitted by bennagebennage(1145) 4 years, 4 months ago

Some description of a help class for working with Enumerations. read more...

2 comments |category: |Views: 44

tags: another

XmlEnumAttribute extrahieren(mac.defx.de)

submitted by sunsidesunside(10) 4 years, 6 months ago

Instruction on how to extract an XmlAttribute from a Member, in particular the XmlEnumAttribute from a enum member. read more...

add a comment |category: |Views: 45

tags: another

Checking a value against an Enum (Enum.IsDefined)(devlicio.us)

submitted by dwhittakerdwhittaker(13.1k) 4 years, 7 months ago

This will check to see if a value (string or int) is a match for a enum. read more...

add a comment |category: |Views: 14

tags: another

Generics without Collections, Part 3(honestillusion.com)

submitted by JamesCurranJamesCurran(635) 4 years, 11 months ago

Using generics for things other than creating collections (Enums this time). Advanced generics use read more...

add a comment |category: |Views: 14

tags: another

Parsing Enum strings in .NET(geekzilla.co.uk)

submitted by fatdavehfatdaveh(1420) 5 years, 1 month ago

A quick and easy tip for converting strings back to Enum types. read more...

2 comments |category: |Views: 17

tags: another

Dustin Campbell: Giving Enums a Little Love(diditwith.net)

submitted by jfollasjfollas(425) 5 years, 5 months ago

Dustin Campbell (Developer Express' Senior "Whipping Boy") discusses improvements that should be made in order to round out the Enumeration data type in .NET (to provide for both increased functionality and improved readability of code that uses enums). read more...

add a comment |category: |Views: 2

tags: another

Generic Parse method on Enum(weblogs.asp.net)

submitted by gavinjoycegavinjoyce(25.7k) 5 years, 7 months ago

A nice little generic enum parser utility class read more...

1 comment |category: |Views: 78

tags: another