Class EnumConverter
- Namespace
- SixLabors.ImageSharp.Web.Commands.Converters
- Assembly
- SixLabors.ImageSharp.Web.dll
The enum converter. Allows conversion to enumerations.
public sealed class EnumConverter : ICommandConverter<object>, ICommandConverter
- Inheritance
-
EnumConverter
- Implements
- Inherited Members
Properties
Type
Gets the type this converter returns.
public Type Type { get; }
Property Value
Methods
ConvertFrom(CommandParser, CultureInfo, string?, Type)
Converts the given string to the type of this converter, using the specified culture information.
public object? ConvertFrom(CommandParser parser, CultureInfo culture, string? value, Type propertyType)
Parameters
parserCommandParserThe command parser use for parting commands.
cultureCultureInfoThe CultureInfo to use as the current parsing culture.
valuestringThe string to convert.
propertyTypeTypeThe property type that the converter will convert to.
Returns
Remarks
Unlike other converters the Type property does not
match the propertyType value.
This allows us to reuse the same converter for infinite enum types.
Exceptions
- NotSupportedException
The conversion cannot be performed.