Table of Contents

WriteObject Method

Definition

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

WriteObject<T>(IDecorator<XmlWriter>, T, Action<XmlFormatterOptions>)

Serializes the specified value into an XML format of the enclosed XmlWriter of the specified decorator.

public static void WriteObject<T>(this IDecorator<XmlWriter> decorator, T value, Action<XmlFormatterOptions> setup = null)

Parameters

decorator IDecorator<XmlWriter>

The IDecorator<T> to extend.

value T

The object to serialize.

setup Action<XmlFormatterOptions>

The XmlFormatterOptions which may be configured.

Type Parameters

T

The type of the object to serialize.

Exceptions

ArgumentNullException

decorator cannot be null.

WriteObject(IDecorator<XmlWriter>, object, Type, Action<XmlFormatterOptions>)

Serializes the specified value into an XML format of the enclosed XmlWriter of the specified decorator.

public static void WriteObject(this IDecorator<XmlWriter> decorator, object value, Type objectType, Action<XmlFormatterOptions> setup = null)

Parameters

decorator IDecorator<XmlWriter>

The IDecorator<T> to extend.

value object

The object to serialize.

objectType Type

The type of the object to serialize.

setup Action<XmlFormatterOptions>

The XmlFormatterOptions which may be configured.

Exceptions

ArgumentNullException

decorator cannot be null.