Esempio n. 1
0
        public static string ToDescriptionString(this DeviceEnum val)
        {
            var attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);

            return(attributes.Length > 0 ? attributes[0].Description : string.Empty);
        }
Esempio n. 2
0
        public static string ToResourceName(this DeviceEnum val)
        {
            var attributes = (DeviceResourceNameAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DeviceResourceNameAttribute), false);

            return(attributes.Length > 0 ? attributes[0].ResourceName : string.Empty);
        }