WriteXmlRootElement Method
Definition
- Namespace
- Cuemon.Extensions.Xml
- Assemblies
- Cuemon.Extensions.Xml.dll
WriteXmlRootElement<T>(XmlWriter, T, Action<XmlWriter, T, XmlQualifiedEntity>, XmlQualifiedEntity)
Writes the XML root element to an existing writer.
public static void WriteXmlRootElement<T>(this XmlWriter writer, T value, Action<XmlWriter, T, XmlQualifiedEntity> treeWriter, XmlQualifiedEntity rootEntity = null)
Parameters
writerXmlWriterThe XmlWriter to extend.
valueTThe object to serialize.
treeWriterAction<XmlWriter, T, XmlQualifiedEntity>The delegate used to write the XML hierarchy.
rootEntityXmlQualifiedEntityThe optional XmlQualifiedEntity that will provide the name of the root element.
Type Parameters
TThe type of the object to serialize.
Exceptions
- ArgumentNullException
writercannot be null.