Class CustomMailAddressConverter
Class for converting between string and MailAddress
Inheritance
Namespace: EPiServer.Configuration
Assembly: EPiServer.Configuration.dll
Version: 8.11.0Syntax
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. |
ctx | The System. |
System. |
type | The System. |
Returns
Type | Description |
---|---|
System. |
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. |
ctx | The System. |
System. |
type | The type to convert to. |
Returns
Type | Description |
---|---|
System. |
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. |
ctx | The context |
System. |
ci | The cultureinfo |
System. |
data | The data to convert |
Returns
Type | Description |
---|---|
System. |
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. |
ctx | The context |
System. |
ci | The cultureinfo |
System. |
value | The value to convert |
System. |
type | The type to convert to |
Returns
Type | Description |
---|---|
System. |
string representation |
Remarks
Only supports conversion to string