Class EnumDisplayConverter
public class EnumDisplayConverter : EnumConverter
- Inheritance
-
EnumDisplayConverter
- Inherited Members
- Extension Methods
Constructors
EnumDisplayConverter(Type)
public EnumDisplayConverter(Type type)
Parameters
typeType
Methods
ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
Converts the specified value object to an enumeration object.
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Parameters
contextITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
cultureCultureInfoAn optional CultureInfo. If not supplied, the current culture is assumed.
valueobjectThe object to convert.
Returns
Exceptions
- FormatException
valueis not a valid value for the target type.- NotSupportedException
The conversion cannot be performed.
ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
Converts the given value object to the specified destination type.
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Parameters
contextITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
cultureCultureInfoAn optional CultureInfo. If not supplied, the current culture is assumed.
valueobjectThe object to convert.
destinationTypeTypeThe Type to convert the value to.
Returns
Exceptions
- ArgumentNullException
destinationTypeis null.- ArgumentException
valueis not a valid value for the enumeration.- NotSupportedException
The conversion cannot be performed.