WriteEncapsulatingElementIfNotNull Method
Definition
- Assemblies
- Cuemon.Xml.dll
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
decoratorIDecorator<XmlWriter>The IDecorator<T> to extend.
valueTThe object to serialize.
elementNameXmlQualifiedEntityThe optional fully qualified name of the element.
nodeWriterAction<XmlWriter, T>The delegate node writer.
Type Parameters
TThe type of the object to serialize.
Exceptions
- ArgumentNullException
decoratorcannot be null.