public class EnumConverter : ArgumentConverter
Public Class EnumConverter
Inherits ArgumentConverter
Dim instance As EnumConverter
public ref class EnumConverter : public ArgumentConverter
This converter performs a case insensitive conversion, and accepts the name of an enumeration value or a number representing the underlying type of the enumeration. Comma-separated values that will be combined using bitwise-or are also accepted, regardless of whether the enumeration uses the FlagsAttribute attribute. When using a numeric value, the value does not need to be one of the defined values of the enumeration.
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(ReadOnlySpanChar, CultureInfo, CommandLineArgument) |
Converts a string span to the enumeration type.
(Overrides ArgumentConverterConvert(ReadOnlySpanChar, CultureInfo, CommandLineArgument)) |
Convert(String, CultureInfo, CommandLineArgument) |
Converts a string to the enumeration type.
(Overrides ArgumentConverterConvert(String, 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) |