diff options
author | sr55 <[email protected]> | 2017-03-17 22:33:48 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2017-03-17 22:33:48 +0000 |
commit | efabefce58e323bc453aa7f7e65004d8880f9efa (patch) | |
tree | 79505319e9a1b46f6ef77dfc4290364525668a6c | |
parent | 6c6570a326e12edb04498b3272b916eb8d431319 (diff) |
WinGui: Remove Usage of System.ComponentModel.DataAnnotations - DisplayName as it's not currently compatible with .NET standard.
22 files changed, 132 insertions, 182 deletions
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 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="DisplayName.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> +// A Display Name for an enum value +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices.Attributes +{ + using System; + + /// <summary> + /// A Short Name for an enum value + /// </summary> + public class DisplayName : Attribute + { + /// <summary> + /// Initializes a new instance of the <see cref="DisplayName"/> class. + /// </summary> + /// <param name="displayName"> + /// The name name. + /// </param> + public DisplayName(string displayName) + { + this.Name = displayName; + } + + /// <summary> + /// Gets the short name. + /// </summary> + 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 @@ <Private>True</Private>
</Reference>
<Reference Include="System" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
@@ -67,6 +66,7 @@ <Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Attributes\DisplayName.cs" />
<Compile Include="Attributes\ShortName.cs" />
<Compile Include="Interop\EventArgs\EncodeCompletedEventArgs.cs" />
<Compile Include="Interop\EventArgs\EncodeProgressEventArgs.cs" />
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;
/// <summary>
@@ -18,16 +16,16 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding /// </summary>
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;
/// <summary>
/// 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;
/// <summary>
@@ -18,55 +16,55 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding /// </summary>
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;
/// <summary>
@@ -18,11 +16,11 @@ namespace HandBrake.ApplicationServices.Model /// </summary>
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 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <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(); } |