FerretArmy: A Web Developer's Paradise

Pushing the Web Forward, Since 2007

Entries Tagged ‘generics’

HybridDictionaries – Careful!

I was refactoring some code the other day, and I noticed that at one point, there was code that created a foreach loop, but it was keeping track of an index inside, by manually incrementing at the end of the foreach loop. Something like this: int index = 0; foreach (Widget widget in WidgetBasket) { [...]

Smart Enumerations, Part II

I’ve made an update to my EnumerationHelpers code since the last release, which you can read about here. Previously, the only attribute that is supported for ‘get’ behavior is the Description attribute. This is all fine and good, but what about when you want to decorate your code with your own custom attributes, yet be [...]

Describable, Smart Enumerations Helper Class (C# 2.0)

Update – Check out this article for the latest and greatest. I’ve decided to post an EnumerationHelpers class written in C# 2.0. This class allows you to easily work with description tags on your enumeration values, and search them to pull the appropriate value out based on the description. This is great for times like [...]