Create Method
Definition
- Namespace
- Cuemon.Xml.Serialization
- Assemblies
- Cuemon.Xml.dll
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 System.Xml.Serialization.IXmlSerializable.GetSchema() through schema.
public static IXmlSerializable Create<T>(T source, Action<XmlWriter, T> writer, Action<XmlReader> reader = null, Func<XmlSchema> schema = null)
Parameters
sourceTThe object that needs support for an IXmlSerializable implementation.
writerAction<XmlWriter, T>The delegate that converts
sourceto its XML representation.readerAction<XmlReader>The delegate that generates
sourcefrom its XML representation.schemaFunc<XmlSchema>The function delegate that can provide a schema of the
source.
Returns
- IXmlSerializable
An IXmlSerializable implementation of
source.
Type Parameters
TThe type of the
sourceto implement an IXmlSerializable.