// -------------------------------------------------------------------------------------------------------------------- // // 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; /// /// 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); } } }