Class TypeConverterRegistrationContext<T>
Establishes context that enables converter registration operations to be performed on the subject type configuration.
Inheritance
Inherited Members
Namespace: ExtendedXmlSerializer.Configuration
Assembly: ExtendedXmlSerializer.dll
Syntax
public sealed class TypeConverterRegistrationContext<T>
Type Parameters
T
|
Constructors
TypeConverterRegistrationContext(ITypeConfiguration<T>)
Creates a new instance.
Declaration
public TypeConverterRegistrationContext(ITypeConfiguration<T> configuration)
Parameters
ITypeConfiguration<T>
configuration
The type configuration under configuration. |
Methods
ByCalling(Func<T, String>, Func<String, T>)
Registers a converter for the provided type. This defines how to deconstruct an instance of the currently configured type into a string for serialization, and to construct an instance of the currently configured type from a string during deserialization.
Declaration
public ITypeConfiguration<T> ByCalling(Func<T, string> format, Func<string, T> parse)
Parameters
System.Func<T, System.String>
format
The formatter to use during serialization. |
System.Func<System.String, T>
parse
The parser to use during deserialization. |
Returns
ITypeConfiguration<T>
The configured type container. |
None()
Removes all registered converters that work with the currently configured type.
Declaration
public ITypeConfiguration<T> None()
Returns
ITypeConfiguration<T>
The configured type configuration. |
Using(IConverter<T>)
Registers a converter for the provided type. This defines how to deconstruct an instance of the currently configured type into a string for serialization, and to construct an instance of the currently configured type from a string during deserialization.
Declaration
public ITypeConfiguration<T> Using(IConverter<T> converter)
Parameters
IConverter<T>
converter
The converter to register. |
Returns
ITypeConfiguration<T>
The configured type container. |
Without(IConverter)
Removes the registration (if any) from the container's converter registration.
Declaration
public ITypeConfiguration<T> Without(IConverter converter)
Parameters
IConverter
converter
The converter to remove from registration. |
Returns
ITypeConfiguration<T>
The configured type container. |
Without(IConverter<T>)
Removes the registration (if any) from the container's converter registration.
Declaration
public ITypeConfiguration<T> Without(IConverter<T> converter)
Parameters
IConverter<T>
converter
The converter to remove from registration. |
Returns
ITypeConfiguration<T>
The configured type container. |