public class EnumConverter : ArgumentConverter
Public Class EnumConverter
Inherits ArgumentConverter
Dim instance As EnumConverter
public ref class EnumConverter : public ArgumentConverter
By default, this converter accepts the names of enumeration members, performing a case-insensitive match. It does not accept numeric values, and comma-separated values are only accepted if the enumeration has the FlagsAttribute attribute.
Use the ValidateEnumValueAttribute attribute to alter these behaviors. Applying that attribute will ensure that only values defined by the enumeration are allowed. The ValidateEnumValueAttributeAllowCommaSeparatedValues property can be used to control the use of multiple values, and the ValidateEnumValueAttributeAllowNumericValues property controls the use of numbers instead of names. Set the ValidateEnumValueAttributeCaseSensitive property to to enable case sensitive conversion.
If conversion fails, the converter will check the ValidateEnumValueAttributeIncludeValuesInErrorMessage property to see whether or not the enumeration's defined values should be listed in the error message. If the argument does not have the ValidateEnumValueAttribute attribute applied, the enumeration's values will be listed in the message.
EnumConverter | Initializes a new instance of the EnumConverter for the specified enumeration type. |
EnumType | Gets the enumeration type that this converter converts to. |
Convert |
Converts a string memory region to the enumeration type.
(Overrides ArgumentConverterConvert(ReadOnlyMemoryChar, CultureInfo, CommandLineArgument)) |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
ToString | Returns a string that represents the current object. (Inherited from Object) |