Class DynamicXmlSerializable
- Namespace
- Cuemon.Xml.Serialization
- Assembly
- Cuemon.Xml.dll
Provides a factory based way to create and wrap an IXmlSerializable implementation.
public static class DynamicXmlSerializable
- Inheritance
-
DynamicXmlSerializable
Methods
Create<T>(T, Action<XmlWriter, T>, Action<XmlReader>, Func<XmlSchema>)
Creates a dynamic instance of an IXmlSerializable implementation wrapping WriteXml(XmlWriter) through writer
, ReadXml(XmlReader) through reader
and GetSchema() through schema
.
public static IXmlSerializable Create<T>(T source, Action<XmlWriter, T> writer, Action<XmlReader> reader = null, Func<XmlSchema> schema = null)
Parameters
source
TThe object that needs support for an IXmlSerializable implementation.
writer
Action<XmlWriter, T>The delegate that converts
source
to its XML representation.reader
Action<XmlReader>The delegate that generates
source
from its XML representation.schema
Func<XmlSchema>The function delegate that can provide a schema of the
source
.
Returns
- IXmlSerializable
An IXmlSerializable implementation of
source
.
Type Parameters
T
The type of the
source
to implement an IXmlSerializable.