Table of Contents

WriteEncapsulatingElementWhenNotNull Method

Definition

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

WriteEncapsulatingElementWhenNotNull<T>(XmlWriter, T, XmlQualifiedEntity, Action<XmlWriter, T>)

Writes the specified value with the delegate nodeWriter. If elementName is not null, then the delegate nodeWriter is called from within an encapsulating Start- and End-element.

public static void WriteEncapsulatingElementWhenNotNull<T>(this XmlWriter writer, T value, XmlQualifiedEntity elementName, Action<XmlWriter, T> nodeWriter)

Parameters

writer XmlWriter

The XmlWriter to extend.

value T

The object to serialize.

elementName XmlQualifiedEntity

The optional fully qualified name of the element.

nodeWriter Action<XmlWriter, T>

The delegate node writer.

Type Parameters

T

The type of the object to serialize.

Exceptions

ArgumentNullException

writer cannot be null.