public EnumConverter(Type enumType)
{
_lookup = new Dictionary<object,string>();
foreach (var e in Enum.GetValues(enumType))
{
_lookup.Add(e, e.ToString());
var attrs = enumType.GetField(e.ToString()).GetCustomAttributes(typeof(FileRepresentationAttribute), false);
if (attrs.Length == 1)
_lookup[e] = ((FileRepresentationAttribute)attrs[0]).Representation;
}
}