Share via


LocalizableEnumConverter Class

Definition

The LocalizableEnumConverter allows for the values of an Enum to be converted to localized strings based on the DisplayNameKey attribute applied to the individual items in the Enum.

public class LocalizableEnumConverter : System.ComponentModel.EnumConverter
type LocalizableEnumConverter = class
    inherit EnumConverter
Public Class LocalizableEnumConverter
Inherits EnumConverter
Inheritance
LocalizableEnumConverter

Examples

public enum ScriptModeOptions { [DisplayNameKey("CreateOnlyMode")] scriptCreateOnly, [DisplayNameKey("DropOnlyMode")] scriptDropOnly }

Constructors

LocalizableEnumConverter(Type)

This constructor is the default constructor that would be used if this converter is placed on an Enum class directly and not via the abstraction through the LocalizedTypeConverter attribute on the containing class.

Methods

ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)

Does the conversion from string to enum and the odd enum to enum. All others are passed on to the base

ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)

Does the conversion from Enum to string and the odd string to string. All others are passed on to the base

GetStandardValues(ITypeDescriptorContext)

Returns the list of values for the list box in the property grid. If the IDynamicVisible interface is defined then we call into that to get the manipulated values array. If not then we just return the list of values.

GetStandardValuesExclusive(ITypeDescriptorContext)
GetStandardValuesSupported(ITypeDescriptorContext)

Applies to