From c800a995fda7b9516a585a1fb3f5daeda3a86f80 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 9 Oct 2011 16:56:31 +0000 Subject: WinGui: Updated EnumHelper with another helper method. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4278 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Functions/EnumHelper.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'win/CS/HandBrake.ApplicationServices') diff --git a/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs b/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs index ad565f0b7..8147f527f 100644 --- a/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs +++ b/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs @@ -6,6 +6,8 @@ namespace HandBrake.ApplicationServices.Functions { using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Reflection; @@ -68,5 +70,25 @@ namespace HandBrake.ApplicationServices.Functions throw new ArgumentOutOfRangeException("The Description for the enum was not recognized."); } + + /// + /// Get a list of string names for each enum value. + /// + /// + /// The enum type. + /// + /// + /// The type of the enum + /// + /// + /// A collection of strings that represent all the enum values + /// + public static IEnumerable GetEnumDisplayValues(Type enumType) + { + var strings = new Collection(); + foreach (T e in Enum.GetValues(enumType)) + strings.Add(GetDisplay(e)); + return strings; + } } } -- cgit v1.2.3