Class CustomMailAddressConverter
Class for converting between string and MailAddress
Inheritance
Namespace: EPiServer.Configuration
Assembly: EPiServer.Configuration.dll
Version: 11.20.7Syntax
public sealed class CustomMailAddressConverter : ConfigurationConverterBase
Constructors
CustomMailAddressConverter()
Declaration
public CustomMailAddressConverter()
Methods
CanConvertFrom(ITypeDescriptorContext, Type)
Determines whether the conversion is allowed.
Declaration
public override bool CanConvertFrom(ITypeDescriptorContext ctx, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.ITypeDescriptorContext | ctx | The System.ComponentModel.ITypeDescriptorContext object used for type conversions. |
System.Type | type | The System.Type to convert from. |
Returns
Type | Description |
---|---|
System.Boolean | true if the conversion is allowed; otherwise, false. |
CanConvertTo(ITypeDescriptorContext, Type)
Determines whether the conversion is allowed.
Declaration
public override bool CanConvertTo(ITypeDescriptorContext ctx, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.ITypeDescriptorContext | ctx | The System.ComponentModel.ITypeDescriptorContext object used for type conversion. |
System.Type | type | The type to convert to. |
Returns
Type | Description |
---|---|
System.Boolean | true if the conversion is allowed; otherwise, false. |
ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)
Converts string to MailAdress
Declaration
public override object ConvertFrom(ITypeDescriptorContext ctx, CultureInfo ci, object data)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.ITypeDescriptorContext | ctx | The context |
System.Globalization.CultureInfo | ci | The cultureinfo |
System.Object | data | The data to convert |
Returns
Type | Description |
---|---|
System.Object | MailAdress |
Remarks
Supports only conversion from string
ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)
Converts MailAdress to string
Declaration
public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.ITypeDescriptorContext | ctx | The context |
System.Globalization.CultureInfo | ci | The cultureinfo |
System.Object | value | The value to convert |
System.Type | type | The type to convert to |
Returns
Type | Description |
---|---|
System.Object | string representation |
Remarks
Only supports conversion to string