summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-07-16 16:05:36 +0000
committersr55 <[email protected]>2011-07-16 16:05:36 +0000
commit8b4dcce5fc1905a5d8facdda89f3e133889a0622 (patch)
tree3f17630d7935f4b9ff0fdf0f339b1d8c6dc2cc31 /win/CS/HandBrake.ApplicationServices/Functions
parent5045c6feeec292db6b538bfe4363c1e3790997fb (diff)
WinGui: Some fixes to the Queue Current encoding information display and removal of another duplicate model.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4111 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Functions')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/Converters.cs6
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs14
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs1
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