By tag: Enum
0
kicks
A closer look at Enum - Weird .NET behaviour
My inner nerd has always enjoyed ripping things apart to figure out what goes on inside of them. This week an Enum (which usually live quiet lives without making a big fuzz about themselves) presented me with some odd behaviour and a great opportunity to take a closer look at what goes on underneath...
0
kicks
DateTime formatting extension method
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 ...
0
kicks
Design Guidelines Update: Enum Design
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 w...
0
kicks
C#: Enhance Enums using Extension Methods
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 coo...
0
kicks
Data Binding an Enum with Descriptions
Finally a SIMPLE, straight-forward, well thought out way to do DataBinding with an Enum.
0
kicks
Validate integer value before casting it to an Enum type
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.
0
kicks
Generic Enum Parsing with Extension Methods
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.
0
kicks
A strongly-typed combobox control for enum values
... 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.
0
kicks
My new little friend, Enum<T>
Some description of a help class for working with Enumerations.
0
kicks
XmlEnumAttribute extrahieren
Instruction on how to extract an XmlAttribute from a Member, in particular the XmlEnumAttribute from a enum member.
0
kicks
Checking a value against an Enum (Enum.IsDefined)
This will check to see if a value (string or int) is a match for a enum.
0
kicks
Generics without Collections, Part 3
Using generics for things other than creating collections (Enums this time). Advanced generics use
0
kicks
Parsing Enum strings in .NET
A quick and easy tip for converting strings back to Enum types.
0
kicks
Dustin Campbell: Giving Enums a Little Love
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).