diff options
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Functions')
3 files changed, 19 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs index b1d92f5d1..e12639e1d 100644 --- a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs +++ b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs @@ -8,7 +8,11 @@ namespace HandBrake.ApplicationServices.Functions using System;
using System.Text.RegularExpressions;
- using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding;
+
+ using AudioEncoder = HandBrake.ApplicationServices.Model.Encoding.AudioEncoder;
+ using Mixdown = HandBrake.ApplicationServices.Model.Encoding.Mixdown;
+ using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
/// <summary>
/// A class to convert various things to native C# objects
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs b/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs index 657434f31..53d7f6069 100644 --- a/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs +++ b/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs @@ -7,6 +7,7 @@ namespace HandBrake.ApplicationServices.Functions {
using System;
using System.ComponentModel;
+ using System.ComponentModel.DataAnnotations;
using System.Reflection;
/// <summary>
@@ -36,6 +37,19 @@ namespace HandBrake.ApplicationServices.Functions }
/// <summary>
+ /// Get the Display Value of the Enum Model
+ /// </summary>
+ /// <param name="value">An Enum with Display Attributes</param>
+ /// <returns>A string name</returns>
+ public static string GetDisplayValue(T value)
+ {
+ FieldInfo fieldInfo = value.GetType().GetField(value.ToString());
+ DisplayAttribute[] attributes = (DisplayAttribute[])fieldInfo.GetCustomAttributes(typeof(DisplayAttribute), false);
+
+ return (attributes.Length > 0) ? attributes[0].Name : value.ToString();
+ }
+
+ /// <summary>
/// Get the Enumeration for a given Enum Description
/// </summary>
/// <param name="description">The String description</param>
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs index 70dc8ea9c..8475c9bd2 100644 --- a/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs +++ b/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs @@ -14,7 +14,6 @@ namespace HandBrake.ApplicationServices.Functions using HandBrake.Interop.Model.Encoding;
using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
- using VideoEncoder = HandBrake.ApplicationServices.Model.Encoding.VideoEncoder;
/// <summary>
/// A Utility Class to Convert a
|