Skip to content

Instantly share code, notes, and snippets.

View SteveDunn's full-sized avatar

Steve Dunn SteveDunn

View GitHub Profile
@SteveDunn
SteveDunn / EnumMapper.cs
Created August 17, 2011 21:25
Enum Mapper in C#
public class EnumMapper : IDisposable
{
readonly Dictionary<Type, Dictionary<string, object>> _stringsToEnums =
new Dictionary<Type, Dictionary<string, object>>( ) ;
readonly Dictionary<Type, Dictionary<int, string>> _enumNumbersToStrings =
new Dictionary<Type, Dictionary<int, string>>( ) ;
readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim( ) ;