diff options
Diffstat (limited to 'win/CS/HandBrakeWPF')
16 files changed, 73 insertions, 153 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/EnumToDescConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumToDescConverter.cs deleted file mode 100644 index 43c175e20..000000000 --- a/win/CS/HandBrakeWPF/Converters/EnumToDescConverter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="EnumToDescConverter.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// Enum to Description Converter -// </summary> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Converters -{ - using System; - using System.ComponentModel; - - using HandBrake.ApplicationServices.Utilities; - - using HandBrakeWPF.Utilities; - - /// <summary> - /// Enum to Description Converter - /// </summary> - public class EnumToDescConverter : EnumConverter - { - /// <summary> - /// Initializes a new instance of the <see cref="EnumToDescConverter"/> class. - /// </summary> - /// <param name="type"> - /// The type. - /// </param> - public EnumToDescConverter(Type type) - : base(type) - { - } - - /// <summary> - /// Convert To an Object. - /// </summary> - /// <param name="context"> - /// The context. - /// </param> - /// <param name="culture"> - /// The culture. - /// </param> - /// <param name="value"> - /// The value. - /// </param> - /// <param name="destinationType"> - /// The destination type. - /// </param> - /// <returns> - /// The Enum Object - /// </returns> - public override object ConvertTo( - ITypeDescriptorContext context, - System.Globalization.CultureInfo culture, - object value, - Type destinationType) - { - return EnumHelper<Enum>.GetDescription((Enum)value); - } - } -} diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 6cf6ae4f6..f984d0120 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -113,7 +113,6 @@ <Reference Include="PresentationFramework" />
<Reference Include="PresentationFramework.Aero" />
<Reference Include="System" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
@@ -157,7 +156,6 @@ <Compile Include="Converters\Audio\AudioRateTypeConverter.cs" />
<Compile Include="Converters\Audio\AudioTrackDefaultBehaviourConverter.cs" />
<Compile Include="Converters\Audio\AudioBehaviourConverter.cs" />
- <Compile Include="Converters\EnumToDescConverter.cs" />
<Compile Include="Converters\Filters\DenoisePresetConverter.cs" />
<Compile Include="Converters\Options\FileSizeConverter.cs" />
<Compile Include="Converters\Options\LogLevelConverter.cs" />
diff --git a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs index 63d88cf21..3a3847b85 100644 --- a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs +++ b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs @@ -18,15 +18,15 @@ namespace HandBrakeWPF.Model.Audio /// </summary>
public enum AudioBehaviourModes
{
- [Display(Name = "No Audio")]
+ [DisplayName("No Audio")]
[ShortName("none")]
None = 0,
- [Display(Name = "First Matching Selected Language")]
+ [DisplayName("First Matching Selected Language")]
[ShortName("first")]
FirstMatch,
- [Display(Name = "All Matching Selected Languages")]
+ [DisplayName("All Matching Selected Languages")]
[ShortName("all")]
AllMatching,
}
diff --git a/win/CS/HandBrakeWPF/Model/Audio/AudioTrackDefaultsMode.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioTrackDefaultsMode.cs index 42f8770cf..475c39e94 100644 --- a/win/CS/HandBrakeWPF/Model/Audio/AudioTrackDefaultsMode.cs +++ b/win/CS/HandBrakeWPF/Model/Audio/AudioTrackDefaultsMode.cs @@ -9,20 +9,20 @@ namespace HandBrakeWPF.Model.Audio
{
- using System.ComponentModel.DataAnnotations;
+ using HandBrake.ApplicationServices.Attributes;
/// <summary>
/// The audio behaviours.
/// </summary>
public enum AudioTrackDefaultsMode
{
- [Display(Name = "Default")]
+ [DisplayName("Default")]
None = 0,
- [Display(Name = "Use First Track as template")]
+ [DisplayName("Use First Track as template")]
FirstTrack,
- [Display(Name = "Use All Tracks as templates")]
+ [DisplayName("Use All Tracks as templates")]
AllTracks,
}
}
diff --git a/win/CS/HandBrakeWPF/Model/OptionsTab.cs b/win/CS/HandBrakeWPF/Model/OptionsTab.cs index b22807e46..4a2c6122a 100644 --- a/win/CS/HandBrakeWPF/Model/OptionsTab.cs +++ b/win/CS/HandBrakeWPF/Model/OptionsTab.cs @@ -9,29 +9,29 @@ namespace HandBrakeWPF.Model
{
- using System.ComponentModel.DataAnnotations;
+ using HandBrake.ApplicationServices.Attributes;
/// <summary>
/// A enum representing each tab on the options screen.
/// </summary>
public enum OptionsTab
{
- [Display(Name = "General")]
+ [DisplayName("General")]
General = 0,
- [Display(Name = "Output Files")]
+ [DisplayName("Output Files")]
OutputFiles,
- [Display(Name = "Video")]
+ [DisplayName("Video")]
Video,
- [Display(Name = "Advanced")]
+ [DisplayName("Advanced")]
Advanced,
- [Display(Name = "Updates")]
+ [DisplayName("Updates")]
Updates,
- [Display(Name = "About HandBrake")]
+ [DisplayName("About HandBrake")]
About,
}
}
diff --git a/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs b/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs index 51d77b8b0..8ef06399f 100644 --- a/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs +++ b/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs @@ -9,18 +9,18 @@ namespace HandBrakeWPF.Model.Picture
{
- using System.ComponentModel.DataAnnotations;
+ using HandBrake.ApplicationServices.Attributes;
/// <summary>
/// Picture Settings Mode when adding presets
/// </summary>
public enum PresetPictureSettingsMode
{
- [Display(Name = "None")]
+ [DisplayName("None")]
None = 0,
- [Display(Name = "Custom")]
+ [DisplayName("Custom")]
Custom = 1,
- [Display(Name = "Always use Source Resolution")]
+ [DisplayName("Always use Source Resolution")]
SourceMaximum = 2,
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviourModes.cs b/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviourModes.cs index ed3e8ed5a..ff50032cc 100644 --- a/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviourModes.cs +++ b/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviourModes.cs @@ -18,15 +18,15 @@ namespace HandBrakeWPF.Model.Subtitles /// </summary>
public enum SubtitleBehaviourModes
{
- [Display(Name = "None")]
+ [DisplayName("None")]
[ShortName("none")]
None = 0,
- [Display(Name = "First Matching Selected Language")]
+ [DisplayName("First Matching Selected Language")]
[ShortName("first")]
FirstMatch,
- [Display(Name = "All Matching Selected Languages")]
+ [DisplayName("All Matching Selected Languages")]
[ShortName("all")]
AllMatching,
}
diff --git a/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBurnInBehaviourModes.cs b/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBurnInBehaviourModes.cs index 193fc2a45..d335a6f10 100644 --- a/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBurnInBehaviourModes.cs +++ b/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBurnInBehaviourModes.cs @@ -9,8 +9,6 @@ namespace HandBrakeWPF.Model.Subtitles
{
- using System.ComponentModel.DataAnnotations;
-
using HandBrake.ApplicationServices.Attributes;
/// <summary>
@@ -18,19 +16,19 @@ namespace HandBrakeWPF.Model.Subtitles /// </summary>
public enum SubtitleBurnInBehaviourModes
{
- [Display(Name = "None")]
+ [DisplayName("None")]
[ShortName("none")]
None = 0,
- [Display(Name = "Foreign Audio Track")]
+ [DisplayName("Foreign Audio Track")]
[ShortName("foreign")]
ForeignAudio,
- [Display(Name = "First Track")]
+ [DisplayName("First Track")]
[ShortName("first")]
FirstTrack,
- [Display(Name = "Foreign Audio Preferred, else First")]
+ [DisplayName("Foreign Audio Preferred, else First")]
[ShortName("foreign_first")]
ForeignAudioPreferred,
}
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioEncoder.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioEncoder.cs index 3a3097521..2dd42c190 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioEncoder.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioEncoder.cs @@ -18,75 +18,75 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// </summary> public enum AudioEncoder { - [Display(Name = "AAC (avcodec)")] + [DisplayName("AAC (avcodec)")] [ShortName("av_aac")] ffaac, - [Display(Name = "AAC (FDK)")] + [DisplayName("AAC (FDK)")] [ShortName("fdk_aac")] fdkaac, - [Display(Name = "HE-AAC (FDK)")] + [DisplayName("HE-AAC (FDK)")] [ShortName("fdk_haac")] fdkheaac, - [Display(Name = "MP3")] + [DisplayName("MP3")] [ShortName("mp3")] Lame, - [Display(Name = "AC3")] + [DisplayName("AC3")] [ShortName("ac3")] Ac3, - [Display(Name = "Auto Passthru")] + [DisplayName("Auto Passthru")] [ShortName("copy")] Passthrough, - [Display(Name = "AC3 Passthru")] + [DisplayName("AC3 Passthru")] [ShortName("copy:ac3")] Ac3Passthrough, - [Display(Name = "E-AC3 Passthru")] + [DisplayName("E-AC3 Passthru")] [ShortName("copy:eac3")] EAc3Passthrough, - [Display(Name = "DTS Passthru")] + [DisplayName("DTS Passthru")] [ShortName("copy:dts")] DtsPassthrough, - [Display(Name = "DTS-HD Passthru")] + [DisplayName("DTS-HD Passthru")] [ShortName("copy:dtshd")] DtsHDPassthrough, - [Display(Name = "TrueHD Passthru")] + [DisplayName("TrueHD Passthru")] [ShortName("copy:truehd")] TrueHDPassthrough, - [Display(Name = "AAC Passthru")] + [DisplayName("AAC Passthru")] [ShortName("copy:aac")] AacPassthru, - [Display(Name = "MP3 Passthru")] + [DisplayName("MP3 Passthru")] [ShortName("copy:mp3")] Mp3Passthru, - [Display(Name = "Vorbis")] + [DisplayName("Vorbis")] [ShortName("vorbis")] Vorbis, - [Display(Name = "FLAC 16-bit")] + [DisplayName("FLAC 16-bit")] [ShortName("flac16")] ffflac, - [Display(Name = "FLAC 24-bit")] + [DisplayName("FLAC 24-bit")] [ShortName("flac24")] ffflac24, - [Display(Name = "FLAC Passthru")] + [DisplayName("FLAC Passthru")] [ShortName("copy:flac")] FlacPassthru, - [Display(Name = "Opus (libopus)")] + [DisplayName("Opus (libopus)")] [ShortName("opus")] Opus, } diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioEncoderRateType.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioEncoderRateType.cs index d1cd21e5b..4b28d9f3d 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioEncoderRateType.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioEncoderRateType.cs @@ -9,7 +9,7 @@ namespace HandBrakeWPF.Services.Encode.Model.Models { - using System.ComponentModel.DataAnnotations; + using HandBrake.ApplicationServices.Attributes; /// <summary> /// The audio encoder rate type. @@ -19,13 +19,13 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// <summary> /// The bitrate. /// </summary> - [Display(Name = "Bitrate: ")] + [DisplayName("Bitrate: ")] Bitrate, /// <summary> /// The quality. /// </summary> - [Display(Name = "Quality: ")] + [DisplayName("Quality: ")] Quality, } } diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/DenoisePreset.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/DenoisePreset.cs index 80ef02d7d..45cfc968e 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/DenoisePreset.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/DenoisePreset.cs @@ -18,27 +18,27 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// </summary> public enum DenoisePreset { - [Display(Name = "Weak")] + [DisplayName("Weak")] [ShortName("weak")] Weak = 0, - [Display(Name = "Medium")] + [DisplayName("Medium")] [ShortName("medium")] Medium, - [Display(Name = "Strong")] + [DisplayName("Strong")] [ShortName("strong")] Strong, - [Display(Name = "Custom")] + [DisplayName("Custom")] [ShortName("custom")] Custom, - [Display(Name = "Ultralight")] // NLMeans only + [DisplayName("Ultralight")] // NLMeans only [ShortName("ultralight")] Ultralight, - [Display(Name = "Light")] // NLMeans only + [DisplayName("Light")] // NLMeans only [ShortName("light")] Light, } diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/DenoiseTune.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/DenoiseTune.cs index 33776e256..8cb4aceb3 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/DenoiseTune.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/DenoiseTune.cs @@ -18,31 +18,31 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// </summary> public enum DenoiseTune { - [Display(Name = "None")] + [DisplayName("None")] [ShortName("none")] None = 0, - [Display(Name = "Film")] + [DisplayName("Film")] [ShortName("film")] Film, - [Display(Name = "Grain")] + [DisplayName("Grain")] [ShortName("grain")] Grain, - [Display(Name = "High Motion")] + [DisplayName("High Motion")] [ShortName("highmotion")] HighMotion, - [Display(Name = "Animation")] + [DisplayName("Animation")] [ShortName("animation")] Animation, - [Display(Name = "Tape")] + [DisplayName("Tape")] [ShortName("tape")] Tape, - [Display(Name = "Sprite")] + [DisplayName("Sprite")] [ShortName("sprite")] Sprite, } diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/OutputFormat.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/OutputFormat.cs index d7e382b06..fee3236ec 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/OutputFormat.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/OutputFormat.cs @@ -9,23 +9,18 @@ namespace HandBrakeWPF.Services.Encode.Model.Models { - using System.ComponentModel; - using System.ComponentModel.DataAnnotations; - using HandBrake.ApplicationServices.Attributes; - + /// <summary> /// The Output format. /// </summary> public enum OutputFormat { - [Description("MP4")] - [Display(Name = "MP4")] + [DisplayName("MP4")] [ShortName("av_mp4")] Mp4 = 0, - [Description("MKV")] - [Display(Name = "MKV")] + [DisplayName("MKV")] [ShortName("av_mkv")] Mkv, } diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/PointToPointMode.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/PointToPointMode.cs index 86f8d0133..4e52d1b8d 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/PointToPointMode.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/PointToPointMode.cs @@ -9,23 +9,23 @@ namespace HandBrakeWPF.Services.Encode.Model.Models { - using System.ComponentModel.DataAnnotations; + using HandBrake.ApplicationServices.Attributes; /// <summary> /// Point to Point Mode /// </summary> public enum PointToPointMode { - [Display(Name = "Chapters")] + [DisplayName("Chapters")] Chapters = 0, - [Display(Name = "Seconds")] + [DisplayName("Seconds")] Seconds, - [Display(Name = "Frames")] + [DisplayName("Frames")] Frames, - [Display(Name = "Preview")] + [DisplayName("Preview")] Preview, } } diff --git a/win/CS/HandBrakeWPF/Services/Queue/Model/QueueItemStatus.cs b/win/CS/HandBrakeWPF/Services/Queue/Model/QueueItemStatus.cs index 92eab43e1..38a93ee37 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/Model/QueueItemStatus.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/Model/QueueItemStatus.cs @@ -9,31 +9,23 @@ namespace HandBrakeWPF.Services.Queue.Model
{
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations;
-
- using HandBrake.ApplicationServices.Converters;
+ using HandBrake.ApplicationServices.Attributes;
/// <summary>
/// Queue Item Status
/// </summary>
- [TypeConverter(typeof(EnumToDescConverter))]
public enum QueueItemStatus
{
- [Description("Waiting")]
- [Display(Name = "Waiting")]
+ [DisplayName("Waiting")]
Waiting = 0,
- [Description("In Progress")]
- [Display(Name = "In Progress")]
+ [DisplayName("In Progress")]
InProgress,
- [Description("Completed")]
- [Display(Name = "Completed")]
+ [DisplayName("Completed")]
Completed,
- [Description("Error")]
- [Display(Name = "Error")]
+ [DisplayName("Error")]
Error,
}
}
diff --git a/win/CS/HandBrakeWPF/Utilities/EnumHelper.cs b/win/CS/HandBrakeWPF/Utilities/EnumHelper.cs index 29202efe6..a39713862 100644 --- a/win/CS/HandBrakeWPF/Utilities/EnumHelper.cs +++ b/win/CS/HandBrakeWPF/Utilities/EnumHelper.cs @@ -13,7 +13,6 @@ namespace HandBrakeWPF.Utilities using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; - using System.ComponentModel.DataAnnotations; using System.Diagnostics; using System.Linq; using System.Reflection; @@ -54,7 +53,7 @@ namespace HandBrakeWPF.Utilities public static string GetDisplay(T value) { FieldInfo fieldInfo = value.GetType().GetField(value.ToString()); - DisplayAttribute[] attributes = (DisplayAttribute[])fieldInfo.GetCustomAttributes(typeof(DisplayAttribute), false); + ShortName[] attributes = (ShortName[])fieldInfo.GetCustomAttributes(typeof(ShortName), false); return (attributes.Length > 0) ? attributes[0].Name : value.ToString(); } |