Class EnumDisplayConverter
public class EnumDisplayConverter : EnumConverter
- Inheritance
-
EnumDisplayConverter
- Inherited Members
- Extension Methods
Constructors
EnumDisplayConverter(Type)
public EnumDisplayConverter(Type type)
Parameters
type
Type
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
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
culture
CultureInfoAn optional CultureInfo. If not supplied, the current culture is assumed.
value
objectThe object to convert.
Returns
Exceptions
- FormatException
value
is 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
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
culture
CultureInfoAn optional CultureInfo. If not supplied, the current culture is assumed.
value
objectThe object to convert.
destinationType
TypeThe Type to convert the value to.
Returns
Exceptions
- ArgumentNullException
destinationType
is null.- ArgumentException
value
is not a valid value for the enumeration.- NotSupportedException
The conversion cannot be performed.