Table of Contents

Class EnumDisplayConverter

Namespace
HeBianGu.Base.WpfBase
Assembly
HeBianGu.Base.WpfBase.dll
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 ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

culture CultureInfo

An optional CultureInfo. If not supplied, the current culture is assumed.

value object

The object to convert.

Returns

object

An object that represents the converted value.

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 ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

culture CultureInfo

An optional CultureInfo. If not supplied, the current culture is assumed.

value object

The object to convert.

destinationType Type

The Type to convert the value to.

Returns

object

An object that represents the converted value.

Exceptions

ArgumentNullException

destinationType is null.

ArgumentException

value is not a valid value for the enumeration.

NotSupportedException

The conversion cannot be performed.