Class ExtensionMethodsForContentModel
Extension methods that assist or enable functionality found within the content model namespace ( ExtendedXmlSerializer.ContentModel).
Inheritance
Inherited Members
Namespace: ExtendedXmlSerializer
Assembly: ExtendedXmlSerializer.dll
Syntax
public static class ExtensionMethodsForContentModel
Methods
Adapt<T>(IConverter<T>)
Given a type-specific converter, create a generalized converter that serializes and deserializes in terms of a general System.Object.
Declaration
public static IConverter Adapt<T>(this IConverter<T> this)
Parameters
IConverter<T>
this
The type-specific converter upon which to base the new generalized converter. |
Returns
IConverter
A generalized IConverter. |
Type Parameters
T
|
Adapt<T>(ISerializer<T>)
Given a type-specific serializer, create a generalized serializer that serializes and deserializes in terms of a general System.Object.
Declaration
public static ISerializer Adapt<T>(this ISerializer<T> this)
Parameters
ISerializer<T>
this
The serializer used to create a new serializer. |
Returns
ISerializer
|
Type Parameters
T
The type that the given serializer uses. |
Adapt<T>(IWriter<T>)
Given a type-specific writer, create a generalized writer that writers in terms of a general System.Object.
Declaration
public static IWriter Adapt<T>(this IWriter<T> this)
Parameters
IWriter<T>
this
The writer instance which to base the new writer. |
Returns
IWriter
The generalized writer. |
Type Parameters
T
The type that the writer is used to write. |
For<T>(ISerializer)
Given a generalized serializer, create a type-specific serializer that handles the specified type. This is typically used for simple casting to and from a general object type and should be handled with care as an incorrect type will throw errors.
Declaration
public static ISerializer<T> For<T>(this ISerializer this)
Parameters
ISerializer
this
The this. |
Returns
ISerializer<T>
ISerializer<T>. |
Type Parameters
T
The type to use for serialization. |
Structured<T>(IConverter<T>)
Given a struct-specific converter, creates its nullable equivalent.
Declaration
public static IConverter<T?> Structured<T>(this IConverter<T> this)
where T : struct
Parameters
IConverter<T>
this
The converter upon which to base the new converter. |
Returns
IConverter<System.Nullable<T>>
IConverter<System.Nullable<T>>. |
Type Parameters
T
The struct type of the converter. |