diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs new file mode 100644 index 000000000..5799425d9 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs @@ -0,0 +1,66 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OptionsTabConverter.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>
+// The Options Tab Converter. Controls which tab is dispalyed.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+
+namespace HandBrakeWPF.Converters.Options
+{
+ using System;
+ using System.Globalization;
+ using System.Windows;
+ using System.Windows.Data;
+
+ /// <summary>
+ /// The Options Tab Converter. Controls which tab is dispalyed.
+ /// </summary>
+ class OptionsTabConverter : IValueConverter
+ {
+ /// <summary>
+ /// Converts a value.
+ /// </summary>
+ /// <returns>
+ /// A converted value. If the method returns null, the valid null value is used.
+ /// </returns>
+ /// <param name="value">The value produced by the binding source.</param><param name="targetType">The type of the binding target property.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null && parameter != null)
+ {
+ switch (value.ToString())
+ {
+ case "General":
+ if (parameter.ToString() == "General") return Visibility.Visible;
+ break;
+ case "Output Files":
+ if (parameter.ToString() == "Output Files") return Visibility.Visible;
+ break;
+ case "Language":
+ if (parameter.ToString() == "Language") return Visibility.Visible;
+ break;
+ case "Advanced":
+ if (parameter.ToString() == "Advanced") return Visibility.Visible;
+ break;
+ }
+ }
+
+ return Visibility.Collapsed;
+ }
+
+ /// <summary>
+ /// Converts a value.
+ /// </summary>
+ /// <returns>
+ /// A converted value. If the method returns null, the valid null value is used.
+ /// </returns>
+ /// <param name="value">The value that is produced by the binding target.</param><param name="targetType">The type to convert to.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
|