namespace HandBrake.ApplicationServices.Functions\r
{\r
using System;\r
+ using System.Collections.Generic;\r
+ using System.Collections.ObjectModel;\r
using System.ComponentModel;\r
using System.ComponentModel.DataAnnotations;\r
using System.Reflection;\r
\r
throw new ArgumentOutOfRangeException("The Description for the enum was not recognized.");\r
}\r
+\r
+ /// <summary>\r
+ /// Get a list of string names for each enum value.\r
+ /// </summary>\r
+ /// <param name="enumType">\r
+ /// The enum type.\r
+ /// </param>\r
+ /// <typeparam name="T">\r
+ /// The type of the enum\r
+ /// </typeparam>\r
+ /// <returns>\r
+ /// A collection of strings that represent all the enum values\r
+ /// </returns>\r
+ public static IEnumerable<string> GetEnumDisplayValues(Type enumType)\r
+ {\r
+ var strings = new Collection<string>();\r
+ foreach (T e in Enum.GetValues(enumType))\r
+ strings.Add(GetDisplay(e));\r
+ return strings;\r
+ }\r
}\r
}\r