From 4a75f67486474b024d2264481cbe9e172a3e98f4 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 13 Oct 2019 18:03:58 +0100 Subject: WinGui: Catchup some remaining strings that were not localisable. #2345 --- .../Converters/Options/Mp4BehaviourConverter.cs | 24 ++++++ .../Converters/Options/ProcessPriorityConverter.cs | 24 ++++++ .../Converters/Options/UpdateCheckConverter.cs | 19 +++++ .../Converters/ResourceConverterBase.cs | 89 ++++++++++++++++++++++ 4 files changed, 156 insertions(+) create mode 100644 win/CS/HandBrakeWPF/Converters/Options/Mp4BehaviourConverter.cs create mode 100644 win/CS/HandBrakeWPF/Converters/Options/ProcessPriorityConverter.cs create mode 100644 win/CS/HandBrakeWPF/Converters/Options/UpdateCheckConverter.cs create mode 100644 win/CS/HandBrakeWPF/Converters/ResourceConverterBase.cs (limited to 'win/CS/HandBrakeWPF/Converters') diff --git a/win/CS/HandBrakeWPF/Converters/Options/Mp4BehaviourConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/Mp4BehaviourConverter.cs new file mode 100644 index 000000000..2ef6ad204 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Options/Mp4BehaviourConverter.cs @@ -0,0 +1,24 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Process Priority Converter +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Options +{ + using System; + using System.ComponentModel; + using System.Globalization; + using System.Linq; + using System.Windows.Data; + + using HandBrakeWPF.Model.Options; + using HandBrakeWPF.Utilities; + + public class Mp4BehaviourConverter : ResourceConverterBase, IValueConverter + { + } +} diff --git a/win/CS/HandBrakeWPF/Converters/Options/ProcessPriorityConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/ProcessPriorityConverter.cs new file mode 100644 index 000000000..2ab2bac66 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Options/ProcessPriorityConverter.cs @@ -0,0 +1,24 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Process Priority Converter +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Options +{ + using System; + using System.ComponentModel; + using System.Globalization; + using System.Linq; + using System.Windows.Data; + + using HandBrakeWPF.Model.Options; + using HandBrakeWPF.Utilities; + + public class ProcessPriorityConverter : ResourceConverterBase, IValueConverter + { + } +} diff --git a/win/CS/HandBrakeWPF/Converters/Options/UpdateCheckConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/UpdateCheckConverter.cs new file mode 100644 index 000000000..3f4de9df7 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Options/UpdateCheckConverter.cs @@ -0,0 +1,19 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the UpdateCheckConverter type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Options +{ + using System.Windows.Data; + + using HandBrakeWPF.Model.Options; + + public class UpdateCheckConverter : ResourceConverterBase, IValueConverter + { + } +} diff --git a/win/CS/HandBrakeWPF/Converters/ResourceConverterBase.cs b/win/CS/HandBrakeWPF/Converters/ResourceConverterBase.cs new file mode 100644 index 000000000..36a588f59 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/ResourceConverterBase.cs @@ -0,0 +1,89 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the ResourceConverterBase type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.Globalization; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + + using HandBrakeWPF.Model.Options; + using HandBrakeWPF.Utilities; + + public class ResourceConverterBase + { + /// + /// The convert. + /// + /// + /// The value. + /// + /// + /// The target type. + /// + /// + /// The parameter. + /// + /// + /// The culture. + /// + /// + /// The . + /// + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null && value.GetType() == typeof(BindingList)) + { + return + new BindingList( + EnumHelper.GetEnumDisplayValues(typeof(T)).ToList()); + } + + if (value != null && value.GetType() == typeof(T)) + { + return EnumHelper.GetDisplay((T)value); + } + + return null; + } + + /// + /// The convert back. + /// + /// + /// The value. + /// + /// + /// The target type. + /// + /// + /// The parameter. + /// + /// + /// The culture. + /// + /// + /// The . + /// + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + string name = value as string; + if (!string.IsNullOrEmpty(name)) + { + return EnumHelper.GetValue(name); + } + + return null; + } + } +} -- cgit v1.2.3