Class EnumBaseConverter<T>
- Namespace
- Svg
- Assembly
- Svg.dll
public abstract class EnumBaseConverter<T> : TypeConverter where T : struct
Type Parameters
T
- Inheritance
-
EnumBaseConverter<T>
- Derived
- Inherited Members
Constructors
EnumBaseConverter(CaseHandling)
Creates a new instance.
public EnumBaseConverter(EnumBaseConverter<T>.CaseHandling caseHandling = CaseHandling.CamelCase)
Parameters
caseHandling
EnumBaseConverter<T>.CaseHandlingDefines if the value shall be converted to camelCase, PascalCase, lowercase or kebab-case.
Properties
CaseHandlingMode
Defines if the enum literal shall be converted to camelCase, PascalCase or kebab-case.
public EnumBaseConverter<T>.CaseHandling CaseHandlingMode { get; }
Property Value
Methods
CanConvertFrom(ITypeDescriptorContext, Type)
Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
sourceType
TypeA Type that represents the type you want to convert from.
Returns
ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
Attempts to convert the provided value to T
.
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Parameters
context
ITypeDescriptorContextculture
CultureInfovalue
object
Returns
ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
Attempts to convert the value to the destination type.
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Parameters
context
ITypeDescriptorContextculture
CultureInfovalue
objectdestinationType
Type