Table of Contents

WriteXmlRootElement Method

Definition

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

WriteXmlRootElement<T>(IDecorator<XmlWriter>, T, Action<XmlWriter, T, XmlQualifiedEntity>, XmlQualifiedEntity)

Writes the XML root element to the enclosed XmlWriter of the specified decorator.

public static void WriteXmlRootElement<T>(this IDecorator<XmlWriter> decorator, T value, Action<XmlWriter, T, XmlQualifiedEntity> treeWriter, XmlQualifiedEntity rootEntity = null)

Parameters

decorator IDecorator<XmlWriter>

The IDecorator<T> 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

decorator cannot be null.