Class MemberSerializationRegistrationContext<T, TMember>
Establishes a serialization registration context for a member configuration.
Inheritance
Inherited Members
Namespace: ExtendedXmlSerializer.Configuration
Assembly: ExtendedXmlSerializer.dll
Syntax
public sealed class MemberSerializationRegistrationContext<T, TMember>
Type Parameters
T
The member's containing type. |
TMember
The member's value type. |
Constructors
MemberSerializationRegistrationContext(IMemberConfiguration<T, TMember>)
Create a new instance.
Declaration
public MemberSerializationRegistrationContext(IMemberConfiguration<T, TMember> member)
Parameters
IMemberConfiguration<T, TMember>
member
The member configuration to configure. |
Methods
ByCalling(Action<IFormatWriter, TMember>, Func<IFormatReader, TMember>)
Registers a new serializer with the provided delegates.
Declaration
public IMemberConfiguration<T, TMember> ByCalling(Action<IFormatWriter, TMember> serialize, Func<IFormatReader, TMember> deserialize)
Parameters
System.Action<IFormatWriter, TMember>
serialize
The delegate to call when serializing an instance of the member's value. |
System.Func<IFormatReader, TMember>
deserialize
The delegate to call when deserializing an instance of the member's value. |
Returns
IMemberConfiguration<T, TMember>
The configured member configuration. |
None()
Clears any serializer that is registered with this type. This will result in this member using the default serialization/deserialization mechanisms of the root serializer for this member's value type.
Declaration
public IMemberConfiguration<T, TMember> None()
Returns
IMemberConfiguration<T, TMember>
The configured member configuration. |
Of(Type)
Used to activate the specified type and register it as this member's serializer. Doing so will allow you to design your serializer to import dependencies into its constructor.
Declaration
public IMemberConfiguration<T, TMember> Of(Type serializerType)
Parameters
System.Type
serializerType
|
Returns
IMemberConfiguration<T, TMember>
The configured member configuration. |
Of<TSerializer>()
Used to activate the specified strongly-typed definition and register it as this member's serializer. Doing so will allow you to design your serializer to import dependencies into its constructor.
Declaration
public IMemberConfiguration<T, TMember> Of<TSerializer>()
where TSerializer : ISerializer<TMember>
Returns
IMemberConfiguration<T, TMember>
The configured member configuration. |
Type Parameters
TSerializer
The serializer type to activate. |
Using(ISerializer)
Provides an instance of a serializer to register as this member's serializer.
Declaration
public IMemberConfiguration<T, TMember> Using(ISerializer serializer)
Parameters
ISerializer
serializer
The serializer to use to serialize/deserialize instances of this member's value. |
Returns
IMemberConfiguration<T, TMember>
The configured member configuration. |
Using(ISerializer<TMember>)
Provides an instance of a serializer to register as this member's serializer.
Declaration
public IMemberConfiguration<T, TMember> Using(ISerializer<TMember> serializer)
Parameters
ISerializer<TMember>
serializer
The serializer to use to serialize/deserialize instances of this member's value. |
Returns
IMemberConfiguration<T, TMember>
The configured member configuration. |