Exemple #1
0
        public static string LongName(this AudioEncoding value)
        {
            FieldInfo         field = value.GetType().GetField(value.ToString());
            LongNameAttribute attribute
                = Attribute.GetCustomAttribute(field, typeof(LongNameAttribute))
                  as LongNameAttribute;

            return(attribute == null?value.ToString() : attribute.LongName);
        }
Exemple #2
0
        public static string Command(this AudioEncoding value)
        {
            FieldInfo        field = value.GetType().GetField(value.ToString());
            CommandAttribute attribute
                = Attribute.GetCustomAttribute(field, typeof(CommandAttribute))
                  as CommandAttribute;

            return(attribute == null?value.ToString() : attribute.Command);
        }