Example #1
0
        /// <summary>
        /// 将汉字转换为属性种类
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static PropertyType GetPropertyTypeByString(string value)
        {
            PropertyTypeConfig config = ConfigManager.GetConfigByName("PropertyType") as PropertyTypeConfig;
            int count = config.GetRecordCount();

            for (int i = 0; i < count; i++)
            {
                if (config.GetRecordById(i).value == value)
                {
                    return((PropertyType)i);
                }
            }
            return(0);
        }
Example #2
0
        /// <summary>
        /// 将属性种类转换为汉字
        /// </summary>
        /// <param name="propertyType"></param>
        /// <returns></returns>
        public static string GetStringByPropertyType(PropertyType propertyType)
        {
            PropertyTypeConfig config = ConfigManager.GetConfigByName("PropertyType") as PropertyTypeConfig;

            return(config.GetRecordById((int)propertyType).value);
        }