Class TypeSerializationRegistrationContext<T>
Used to configure the serializer that is used to write this object to the output document during the serialization process, and to read from the provided document during the deserialization process.
Inheritance
Inherited Members
Namespace: ExtendedXmlSerializer.Configuration
Assembly: ExtendedXmlSerializer.dll
Syntax
public sealed class TypeSerializationRegistrationContext<T>
Type Parameters
T
The type under configuration. |
Constructors
TypeSerializationRegistrationContext(ITypeConfiguration<T>)
Creates a new instance.
Declaration
public TypeSerializationRegistrationContext(ITypeConfiguration<T> configuration)
Parameters
ITypeConfiguration<T>
configuration
The type configuration under configuration. |
Methods
ByCalling(Action<IFormatWriter, T>, Func<IFormatReader, T>)
Registers a new serializer with the provided delegates.
Declaration
public ITypeConfiguration<T> ByCalling(Action<IFormatWriter, T> serialize, Func<IFormatReader, T> deserialize)
Parameters
System.Action<IFormatWriter, T>
serialize
The delegate to call when serializing an instance of the configured type. |
System.Func<IFormatReader, T>
deserialize
The delegate to call when deserializing an instance of the configured type. |
Returns
ITypeConfiguration<T>
The configured type configuration. |
Composer()
Establishes a content-composition context.
Declaration
public TypeSerializerComposerRegistrationContext<T> Composer()
Returns
TypeSerializerComposerRegistrationContext<T>
A context to perform operations for registering content serializer composition for the type under configuration. |
None()
Clears any serializer that is registered with this type. This will result in this type using the default serialization/deserialization mechanisms of the root serializer for instances of this type.
Declaration
public ITypeConfiguration<T> None()
Returns
ITypeConfiguration<T>
The configuration type configuration. |
Of(Type)
Used to activate the specified type and register it as this type's serializer. Doing so will allow you to design your serializer to import dependencies into its constructor.
Declaration
public ITypeConfiguration<T> Of(Type serializerType)
Parameters
System.Type
serializerType
|
Returns
ITypeConfiguration<T>
The configured type configuration. |
Of<TSerializer>()
Used to activate the specified type and register it as this type's serializer. Doing so will allow you to design your serializer to import dependencies into its constructor.
Declaration
public ITypeConfiguration<T> Of<TSerializer>()
where TSerializer : ISerializer<T>
Returns
ITypeConfiguration<T>
The configured type configuration. |
Type Parameters
TSerializer
The serializer type to activate. |
Using(ISerializer)
Provides an instance of a serializer to register as this type's serializer.
Declaration
public ITypeConfiguration<T> Using(ISerializer serializer)
Parameters
ISerializer
serializer
The serializer to use to serialize/deserialize instances of this type. |
Returns
ITypeConfiguration<T>
The configured type configuration. |
Using(ISerializer<T>)
Provides an instance of a serializer to register as this type's serializer.
Declaration
public ITypeConfiguration<T> Using(ISerializer<T> serializer)
Parameters
ISerializer<T>
serializer
The serializer to use to serialize/deserialize instances of this type. |
Returns
ITypeConfiguration<T>
The configured type configuration. |