Table of Contents

WriteEncapsulatingElementIfNotNull Method

Definition

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

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

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

public static void WriteEncapsulatingElementIfNotNull<T>(this IDecorator<XmlWriter> decorator, T value, XmlQualifiedEntity elementName, Action<XmlWriter, T> nodeWriter)

Parameters

decorator IDecorator<XmlWriter>

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

decorator cannot be null.