From efabefce58e323bc453aa7f7e65004d8880f9efa Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 17 Mar 2017 22:33:48 +0000 Subject: WinGui: Remove Usage of System.ComponentModel.DataAnnotations - DisplayName as it's not currently compatible with .NET standard. --- .../Attributes/DisplayName.cs | 35 ++++++++++++ .../HandBrake.ApplicationServices.csproj | 2 +- .../Interop/Model/Encoding/Anamorphic.cs | 10 ++-- .../Interop/Model/Encoding/Container.cs | 7 +-- .../Interop/Model/Encoding/VideoEncoder.cs | 28 +++++----- .../Model/VideoScaler.cs | 6 +-- .../HandBrakeWPF/Converters/EnumToDescConverter.cs | 62 ---------------------- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 2 - .../Model/Audio/AudioBehaviourModes.cs | 6 +-- .../Model/Audio/AudioTrackDefaultsMode.cs | 8 +-- win/CS/HandBrakeWPF/Model/OptionsTab.cs | 14 ++--- .../Model/Picture/PresetPictureSettingsMode.cs | 8 +-- .../Model/Subtitles/SubtitleBehaviourModes.cs | 6 +-- .../Subtitles/SubtitleBurnInBehaviourModes.cs | 10 ++-- .../Services/Encode/Model/Models/AudioEncoder.cs | 36 ++++++------- .../Encode/Model/Models/AudioEncoderRateType.cs | 6 +-- .../Services/Encode/Model/Models/DenoisePreset.cs | 12 ++--- .../Services/Encode/Model/Models/DenoiseTune.cs | 14 ++--- .../Services/Encode/Model/Models/OutputFormat.cs | 11 ++-- .../Encode/Model/Models/PointToPointMode.cs | 10 ++-- .../Services/Queue/Model/QueueItemStatus.cs | 18 ++----- win/CS/HandBrakeWPF/Utilities/EnumHelper.cs | 3 +- 22 files changed, 132 insertions(+), 182 deletions(-) create mode 100644 win/CS/HandBrake.ApplicationServices/Attributes/DisplayName.cs delete mode 100644 win/CS/HandBrakeWPF/Converters/EnumToDescConverter.cs diff --git a/win/CS/HandBrake.ApplicationServices/Attributes/DisplayName.cs b/win/CS/HandBrake.ApplicationServices/Attributes/DisplayName.cs new file mode 100644 index 000000000..e96c9ab73 --- /dev/null +++ b/win/CS/HandBrake.ApplicationServices/Attributes/DisplayName.cs @@ -0,0 +1,35 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// A Display Name for an enum value +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices.Attributes +{ + using System; + + /// + /// A Short Name for an enum value + /// + public class DisplayName : Attribute + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The name name. + /// + public DisplayName(string displayName) + { + this.Name = displayName; + } + + /// + /// Gets the short name. + /// + public string Name { get; private set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index 977794e1b..c5f5555e9 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -55,7 +55,6 @@ True - 3.5 @@ -67,6 +66,7 @@ + diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs index b73829fc8..26ac4883c 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs @@ -9,8 +9,6 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding { - using System.ComponentModel.DataAnnotations; - using HandBrake.ApplicationServices.Attributes; /// @@ -18,16 +16,16 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding /// public enum Anamorphic { - [Display(Name = "None")] + [DisplayName("None")] [ShortName("none")] None = 0, - [Display(Name = "Automatic")] + [DisplayName("Automatic")] [ShortName("auto")] Automatic = 4, - [Display(Name = "Loose")] + [DisplayName("Loose")] [ShortName("loose")] Loose = 2, - [Display(Name = "Custom")] + [DisplayName("Custom")] [ShortName("custom")] Custom = 3 } diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs index 0140c5678..b8eab8dad 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs @@ -10,7 +10,8 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding { using System; - using System.ComponentModel.DataAnnotations; + + using HandBrake.ApplicationServices.Attributes; /// /// The container. @@ -20,9 +21,9 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding { None = 0x0, - [Display(Name = "MP4")] + [DisplayName("MP4")] MP4, - [Display(Name = "MKV")] + [DisplayName("MKV")] MKV } } diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs index 077b9a642..e2b82db1d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs @@ -9,8 +9,6 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding { - using System.ComponentModel.DataAnnotations; - using HandBrake.ApplicationServices.Attributes; /// @@ -18,55 +16,55 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding /// public enum VideoEncoder { - [Display(Name = "H.264 (x264)")] + [DisplayName("H.264 (x264)")] [ShortName("x264")] X264 = 0, - [Display(Name = "H.264 10-bit (x264)")] + [DisplayName("H.264 10-bit (x264)")] [ShortName("x264_10bit")] X264_10, - [Display(Name = "H.264 (Intel QSV)")] + [DisplayName("H.264 (Intel QSV)")] [ShortName("qsv_h264")] QuickSync, - [Display(Name = "MPEG-4")] + [DisplayName("MPEG-4")] [ShortName("mpeg4")] FFMpeg, - [Display(Name = "MPEG-2")] + [DisplayName("MPEG-2")] [ShortName("mpeg2")] FFMpeg2, - [Display(Name = "Theora")] + [DisplayName("Theora")] [ShortName("theora")] Theora, - [Display(Name = "H.265 (x265)")] + [DisplayName("H.265 (x265)")] [ShortName("x265")] X265, - [Display(Name = "H.265 12-bit (x265)")] + [DisplayName("H.265 12-bit (x265)")] [ShortName("x265_12bit")] X265_12, - [Display(Name = "H.265 10-bit (x265)")] + [DisplayName("H.265 10-bit (x265)")] [ShortName("x265_10bit")] X265_10, - [Display(Name = "H.265 (Intel QSV)")] + [DisplayName("H.265 (Intel QSV)")] [ShortName("qsv_h265")] QuickSyncH265, - [Display(Name = "H.265 10-bit (Intel QSV)")] + [DisplayName("H.265 10-bit (Intel QSV)")] [ShortName("qsv_h265_10bit")] QuickSyncH26510b, - [Display(Name = "VP8")] + [DisplayName("VP8")] [ShortName("VP8")] VP8, - [Display(Name = "VP9")] + [DisplayName("VP9")] [ShortName("VP9")] VP9 } diff --git a/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs b/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs index 5d26040a8..6a7323ca1 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs @@ -9,8 +9,6 @@ namespace HandBrake.ApplicationServices.Model { - using System.ComponentModel.DataAnnotations; - using HandBrake.ApplicationServices.Attributes; /// @@ -18,11 +16,11 @@ namespace HandBrake.ApplicationServices.Model /// public enum VideoScaler { - [Display(Name = "Lanczos (default)")] + [DisplayName("Lanczos (default)")] [ShortName("swscale")] Lanczos = 0, - [Display(Name = "Bicubic (OpenCL)")] + [DisplayName("Bicubic (OpenCL)")] [ShortName("opencl")] BicubicCl, } 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 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Enum to Description Converter -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Converters -{ - using System; - using System.ComponentModel; - - using HandBrake.ApplicationServices.Utilities; - - using HandBrakeWPF.Utilities; - - /// - /// Enum to Description Converter - /// - public class EnumToDescConverter : EnumConverter - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The type. - /// - public EnumToDescConverter(Type type) - : base(type) - { - } - - /// - /// Convert To an Object. - /// - /// - /// The context. - /// - /// - /// The culture. - /// - /// - /// The value. - /// - /// - /// The destination type. - /// - /// - /// The Enum Object - /// - public override object ConvertTo( - ITypeDescriptorContext context, - System.Globalization.CultureInfo culture, - object value, - Type destinationType) - { - return EnumHelper.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 @@ - @@ -157,7 +156,6 @@ - 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 /// 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; /// /// The audio behaviours. /// 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; /// /// A enum representing each tab on the options screen. /// 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; /// /// Picture Settings Mode when adding presets /// 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 /// 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; /// @@ -18,19 +16,19 @@ namespace HandBrakeWPF.Model.Subtitles /// 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 /// 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; /// /// The audio encoder rate type. @@ -19,13 +19,13 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// /// The bitrate. /// - [Display(Name = "Bitrate: ")] + [DisplayName("Bitrate: ")] Bitrate, /// /// The quality. /// - [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 /// 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 /// 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; - + /// /// The Output format. /// 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; /// /// Point to Point Mode /// 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; /// /// Queue Item Status /// - [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(); } -- cgit v1.2.3