Table of Contents

WriteXmlRootElement Method

Definition

Namespace
Cuemon.Extensions.Xml
Assemblies
Cuemon.Extensions.Xml.dll
Source
src/Cuemon.Extensions.Xml/XmlWriterExtensions.cs

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

writer XmlWriter

The XmlWriter to extend.

value T

The object to serialize.

treeWriter Action<XmlWriter, T, XmlQualifiedEntity>

The delegate used to write the XML hierarchy.

rootEntity XmlQualifiedEntity

The optional XmlQualifiedEntity that will provide the name of the root element.

Type Parameters

T

The type of the object to serialize.

Exceptions

ArgumentNullException

writer cannot be null.