From 3bb7333006c2ace5e3aaabfc80c5a00dcd92350e Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 29 Dec 2012 14:25:17 +0000 Subject: WinGui: Add the plist keys and fix numerous bugs in the x264 preset/tune/profile/level code. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5115 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Utilities/EnumHelper.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'win/CS/HandBrake.ApplicationServices/Utilities/EnumHelper.cs') diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/EnumHelper.cs b/win/CS/HandBrake.ApplicationServices/Utilities/EnumHelper.cs index d6c972b5e..c854e5a05 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/EnumHelper.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/EnumHelper.cs @@ -62,6 +62,17 @@ namespace HandBrake.ApplicationServices.Utilities /// The String description /// The Enum Value public static T GetValue(string description) + { + return GetValue(description, false); + } + + /// + /// Get the Enumeration for a given Enum Description + /// + /// The String description + /// Turn of sensitivity to cases. + /// The Enum Value + public static T GetValue(string description, bool insensitiveCase) { foreach (T val in Enum.GetValues(typeof(T))) { @@ -71,6 +82,12 @@ namespace HandBrake.ApplicationServices.Utilities { return val; } + + if (insensitiveCase && currDescription.ToLower() == description.ToLower() || + currDisplay.ToLower() == description.ToLower()) + { + return val; + } } throw new ArgumentOutOfRangeException("The Description for the enum was not recognized."); -- cgit v1.2.3