// --------------------------------------------------------------------------------------------------------------------
//
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
//
//
// Defines the BooleanToVisibilityConverter type.
//
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrakeWPF.Converters
{
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Data;
using System;
using HandBrake.ApplicationServices.Functions;
using HandBrake.Interop.Model.Encoding;
///
/// Boolean to Visibility Converter
///
public sealed class AudioEnumConverter : IValueConverter
{
///
/// Convert an Enum to it's display value (attribute)
///
///
/// The value.
///
///
/// The target type.
///
///
/// The parameter. (A boolean which inverts the output)
///
///
/// The culture.
///
///
/// Visibility property
///
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is Mixdown)
{
return EnumHelper.GetEnumDisplayValues(value.GetType());
}
else if (value is AudioEncoder)
{
return EnumHelper.GetEnumDisplayValues(value.GetType());
}
return new List();
}
///
/// Convert Back for the IValueConverter Interface. Not used!
///
///
/// The value.
///
///
/// The target type.
///
///
/// The parameter.
///
///
/// The culture.
///
///
/// Nothing
///
///
/// This method is not used!
///
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}