Class ExtensionMethodsForAlteration
Extension methods that assist or enable functionality for altering content produced (or read in) by the container, its types, and/or its type's members.
Inheritance
Inherited Members
Namespace: ExtendedXmlSerializer
Assembly: ExtendedXmlSerializer.dll
Syntax
public static class ExtensionMethodsForAlteration
Methods
Alter(IConfigurationContainer, IAlteration<IConverter>)
Provides a way to alter converters when they are accessed by the serializer. This provides a mechanism to decorate converters. Alterations only occur once per converter per serializer.
Declaration
public static IConfigurationContainer Alter(this IConfigurationContainer this, IAlteration<IConverter> alteration)
Parameters
IConfigurationContainer
this
The container to configure. |
IAlteration<IConverter>
alteration
The alteration to perform on each converter when it is accessed by the serializer. |
Returns
IConfigurationContainer
The configured container. |
Alter<T>(ITypeConfiguration<T>, IAlteration<T>, IAlteration<T>)
Used to alter an instance of the configured result type whenever it is encountered during the serialization or deserialization process. This can be used in scenarios where it is desired to know when an instance of a particular type is emitted or read (for logging purposes, etc.) or, more generally, to alter it in some way (scrubbing data, etc) before it is written to the external stream or read into memory. You can consider this as a value interception of the serialization/deserialization pipeline.
Declaration
public static ITypeConfiguration<T> Alter<T>(this ITypeConfiguration<T> this, IAlteration<T> read, IAlteration<T> write)
Parameters
ITypeConfiguration<T>
this
The type configuration to configure. |
IAlteration<T>
read
The alteration to apply during reading. |
IAlteration<T>
write
The alteration to apply during writing. |
Returns
ITypeConfiguration<T>
The configured type configuration. |
Type Parameters
T
The type under configuration. |
Alter<T>(ITypeConfiguration<T>, Func<T, T>)
Used to alter an instance of the configured result type whenever it is encountered during the serialization process. This can be used in scenarios where it is desired to know when an instance of a particular type is emitted (for logging purposes, etc.) or, more generally, to alter it in some way (scrubbing data, etc) before it is written to the external stream. You can consider this as a value interception of the serialization pipeline.
Declaration
public static ITypeConfiguration<T> Alter<T>(this ITypeConfiguration<T> this, Func<T, T> write)
Parameters
ITypeConfiguration<T>
this
The type configuration to configure. |
System.Func<T, T>
write
The alteration delegate to invoke during writing. |
Returns
ITypeConfiguration<T>
The configured type configuration. |
Type Parameters
T
The type under configuration. |
Alter<T>(ITypeConfiguration<T>, Func<T, T>, Func<T, T>)
Used to alter an instance of the configured result type whenever it is encountered during the serialization or deserialization process. This can be used in scenarios where it is desired to know when an instance of a particular type is emitted or read (for logging purposes, etc.) or, more generally, to alter it in some way (scrubbing data, etc) before it is written to the external stream or read into memory. You can consider this as a value interception of the serialization/deserialization pipeline.
Declaration
public static ITypeConfiguration<T> Alter<T>(this ITypeConfiguration<T> this, Func<T, T> read, Func<T, T> write)
Parameters
ITypeConfiguration<T>
this
The type configuration to configure. |
System.Func<T, T>
read
The alteration delegate to invoke during reading. |
System.Func<T, T>
write
The alteration delegate to invoke during writing. |
Returns
ITypeConfiguration<T>
The configured type configuration. |
Type Parameters
T
The type under configuration. |
Alter<T, TMember>(IMemberConfiguration<T, TMember>, IAlteration<TMember>, IAlteration<TMember>)
Used to alter the value of a member whenever it is encountered during the serialization or deserialization process. This can be used in scenarios where it is desired to know when a the value of a member is emitted or read (for logging purposes, etc.) or, more generally, to alter it in some way (scrubbing data, etc) before it is written to the external stream or read into memory. You can consider this as a member value interception of the serialization/deserialization pipeline.
Declaration
public static IMemberConfiguration<T, TMember> Alter<T, TMember>(this IMemberConfiguration<T, TMember> this, IAlteration<TMember> read, IAlteration<TMember> write)
Parameters
IMemberConfiguration<T, TMember>
this
The member configuration under configuration. |
IAlteration<TMember>
read
The alteration to apply to the member value when it is read. |
IAlteration<TMember>
write
The alteration to apply to the member value when it is written. |
Returns
IMemberConfiguration<T, TMember>
The configured member configuration. |
Type Parameters
T
The containing type under configuration. |
TMember
The member's value type. |
Alter<T, TMember>(IMemberConfiguration<T, TMember>, Func<TMember, TMember>)
Used to alter the value of a member whenever it is encountered during the serialization process. This can be used in scenarios where it is desired to know when a the value of a member is emitted (for logging purposes, etc.) or, more generally, to alter it in some way (scrubbing data, etc) before it is written to the external stream. You can consider this as a member value interception of the serialization pipeline.
Declaration
public static IMemberConfiguration<T, TMember> Alter<T, TMember>(this IMemberConfiguration<T, TMember> this, Func<TMember, TMember> write)
Parameters
IMemberConfiguration<T, TMember>
this
The member configuration under configuration. |
System.Func<TMember, TMember>
write
The alteration delegate to invoke on the member value when it is written. |
Returns
IMemberConfiguration<T, TMember>
The configured member configuration. |
Type Parameters
T
The containing type under configuration. |
TMember
The member's value type. |
Alter<T, TMember>(IMemberConfiguration<T, TMember>, Func<TMember, TMember>, Func<TMember, TMember>)
Used to alter the value of a member whenever it is encountered during the serialization or deserialization process. This can be used in scenarios where it is desired to know when a the value of a member is emitted or read (for logging purposes, etc.) or, more generally, to alter it in some way (scrubbing data, etc) before it is written to the external stream or read into memory. You can consider this as a member value interception of the serialization/deserialization pipeline.
Declaration
public static IMemberConfiguration<T, TMember> Alter<T, TMember>(this IMemberConfiguration<T, TMember> this, Func<TMember, TMember> read, Func<TMember, TMember> write)
Parameters
IMemberConfiguration<T, TMember>
this
The member configuration under configuration. |
System.Func<TMember, TMember>
read
The alteration delegate to invoke on the member value when it is read. |
System.Func<TMember, TMember>
write
The alteration delegate to invoke on the member value when it is written. |
Returns
IMemberConfiguration<T, TMember>
The configured member configuration. |
Type Parameters
T
The containing type under configuration. |
TMember
The member's value type. |
RegisterContentComposition<T>(ITypeConfiguration<T>, ISerializerComposer)
Used to alter a serializer whenever one is created for a specific type. This allows the scenario of decorating a serializer to override or monitor serialization and/or deserialization. This override accepts an ISerializerComposer that performs the alteration on the created serializer.
Declaration
[Obsolete("This method is considered obsolete and will be removed in a future release. Its new equivalent is ITypeConfiguration<T>.Register().Serializer().Composer().Using.")]
public static ITypeConfiguration<T> RegisterContentComposition<T>(this ITypeConfiguration<T> this, ISerializerComposer composer)
Parameters
ITypeConfiguration<T>
this
The type configuration to configure. |
ISerializerComposer
composer
The composer that is used to alter the serializer upon creation. |
Returns
ITypeConfiguration<T>
The configured type configuration. |
Type Parameters
T
The type that the serializer processes. |
See Also
RegisterContentComposition<T>(ITypeConfiguration<T>, Func<ISerializer, ISerializer>)
Used to alter a serializer whenever one is created for a specific type. This allows the scenario of decorating a serializer to override or monitor serialization and/or deserialization. This override accepts a generalized serializer delegate.
Declaration
[Obsolete("This method is considered obsolete and will be removed in a future release. Its new equivalent is ITypeConfiguration<T>.Register().Serializer().Composer().ByCalling.")]
public static ITypeConfiguration<T> RegisterContentComposition<T>(this ITypeConfiguration<T> this, Func<ISerializer, ISerializer> compose)
Parameters
ITypeConfiguration<T>
this
The type configuration to configure. |
System.Func<ISerializer, ISerializer>
compose
The delegate used to alterate the created serializer. |
Returns
ITypeConfiguration<T>
The configured type configuration. |
Type Parameters
T
The type that the serializer processes. |
See Also
RegisterContentComposition<T>(ITypeConfiguration<T>, Func<ISerializer<T>, ISerializer<T>>)
Used to alter a serializer whenever one is created for a specific type. This allows the scenario of decorating a serializer to override or monitor serialization and/or deserialization.
Declaration
[Obsolete("This method is considered obsolete and will be removed in a future release. Its new equivalent is ITypeConfiguration<T>.Register().Serializer().Composer().ByCalling.")]
public static ITypeConfiguration<T> RegisterContentComposition<T>(this ITypeConfiguration<T> this, Func<ISerializer<T>, ISerializer<T>> compose)
Parameters
ITypeConfiguration<T>
this
The type configuration to configure. |
System.Func<ISerializer<T>, ISerializer<T>>
compose
The delegate used to alterate the created serializer. |
Returns
ITypeConfiguration<T>
The configured type configuration. |
Type Parameters
T
The type that the serializer processes. |