Esempio n. 1
0
        /// <summary>
        /// Gets the file type prefix for the enum value from its description.
        /// </summary>
        /// <param name="value">The enum value</param>
        /// <returns>The race code</returns>
        public static string GetSystemName(this XivItemType value)
        {
            var field     = value.GetType().GetField(value.ToString());
            var attribute = (DescriptionAttribute[])field.GetCustomAttributes(typeof(DescriptionAttribute), false);

            return(attribute.Length > 0 ? attribute[0].Description : value.ToString());
        }