获取枚举的国际化Key
来源:互联网 发布:php 粘贴 编辑:程序博客网 时间:2024/05/22 15:44
public class EnumUtils
{
public static string GetKey<T>(int value)
{
string key = string.Empty;
bool isDefined = Enum.IsDefined(typeof(T), value);
if (isDefined)
key = "Enum." + typeof(T).Name + "." + Enum.Parse(typeof(T), value.ToString()).ToString();
else
key = "Enum." + typeof(T).Name + "." + "None";
return key;
}
}
{
public static string GetKey<T>(int value)
{
string key = string.Empty;
bool isDefined = Enum.IsDefined(typeof(T), value);
if (isDefined)
key = "Enum." + typeof(T).Name + "." + Enum.Parse(typeof(T), value.ToString()).ToString();
else
key = "Enum." + typeof(T).Name + "." + "None";
return key;
}
}
- 获取枚举的国际化Key
- 关于枚举enum获取key和值的问题,枚举(二)
- 获取控件的key
- 获取json的key
- 获取枚举的名称
- Missing message for key 。。struts国际化的问题
- 根据枚举值获取枚举的描述
- JSONObject获取KEY的方法
- Map获取key的数组
- mac ssh key 的获取
- mac ssh key 的获取
- mac ssh key 的获取
- 获取数据库的key值
- mac ssh key 的获取
- 如何获取对象的key
- 获取每个插件(bunlde)的国际化文件
- C# 枚举的获取方法
- 获取枚举的所有注释
- VIM 键盘图
- Source Insight 3.5设置支持汇编文件
- POJ 3734 Blocks 矩阵乘法
- Serializable 作用
- Xcode4 SVN配置
- 获取枚举的国际化Key
- SQL 模糊查询
- linux中关于函数的man查询
- Oracle OIM 原理
- input和textarea在IE和FF下的统一高度设置
- U-Boot-2010.12移植到2440
- MyEclipse6.5 下Axis2插件的下载和安装
- assert用法总结
- Android 4.0 的发布了