我enum
帮手泛型类在那里我有方法EnumDescription()
要调用它,我必须去这样EnumHelper<Enumtype>.EnumDescription(value)
我想要实现enum
扩展,它基于我的枚举的辅助方法方法EnumDescription(this Enum value)
EnumHelper<T>.EnumDescription(value)
帮助枚举扩展方法
有一件事我被困住了。这里是我的代码:
public static string EnumDescription(this Enum value)
{
Type type = value.GetType();
return EnumHelper<type>.EnumDescription(value); //Error here
}
我得到一个错误The type or namespace name 'type' could not be found (are you missing a using directive or an assembly reference?)
,请问有什么可以做,使工作?
你想给Enum一个很好的描述? – PostMan 2011-02-16 00:26:05