Esempio n. 1
0
        /// <summary>
        /// 获取本枚举里边所有属性的信息
        /// </summary>
        /// <param name="enumType">枚举类型</param>
        /// <returns></returns>
        public static List <EnumInfo> GetEnumInfos(Type enumType)
        {
            List <EnumInfo> dicInfos = MassManager.GetMassInfos(enumType).LstInfo;

            return(dicInfos);
        }
Esempio n. 2
0
 /// <summary>
 /// 根据枚举的属性名来获取其信息
 /// </summary>
 /// <param name="enumType">枚举类型</param>
 /// <param name="name">属性名称</param>
 /// <returns></returns>
 public static EnumInfo GetEnumInfoByName(Type enumType, string name)
 {
     return(MassManager.GetInfoByName(enumType, name));
 }
Esempio n. 3
0
 /// <summary>
 /// 获取枚举值的信息
 /// </summary>
 /// <param name="objEnum">枚举值</param>
 /// <returns></returns>
 public static EnumInfo GetEnumInfo(Enum objEnum)
 {
     return(MassManager.GetInfoByValue(objEnum.GetType(), objEnum));
 }
Esempio n. 4
0
 /// <summary>
 /// 根据常量类的字段名来获取其信息
 /// </summary>
 /// <param name="name">字段名</param>
 /// <returns></returns>
 public static EnumInfo GetInfoByName(string name)
 {
     return(MassManager.GetInfoByName(_curType, name));
 }
Esempio n. 5
0
 /// <summary>
 /// 获取常量值对应的信息
 /// </summary>
 /// <param name="value">常量值</param>
 /// <returns></returns>
 public static EnumInfo GetInfo(object value)
 {
     return(MassManager.GetInfoByValue(_curType, value));
 }
Esempio n. 6
0
        private static Type _curType = typeof(T);//当前类型
        /// <summary>
        /// 获取本常量类里边所有属性的信息
        /// </summary>
        /// <param name="enumType">枚举类型</param>
        /// <returns></returns>
        public static List <EnumInfo> GetInfos()
        {
            List <EnumInfo> dicInfos = MassManager.GetMassInfos(_curType).LstInfo;

            return(dicInfos);
        }