/// <summary> /// Gets the path of the bonus type. /// </summary> /// <param name="val">The value.</param> /// <returns></returns> public static string ToDescriptionString(BonusType val) { DescriptionAttribute[] attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false); return attributes.Length > 0 ? attributes[0].Description : string.Empty; }