Table of Contents

WriteObject Method

Definition

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

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

Serializes the specified value into an XML format.

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

Parameters

writer XmlWriter

The XmlWriter 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

writer cannot be null.

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

Serializes the specified value into an XML format.

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

Parameters

writer XmlWriter

The XmlWriter 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

writer cannot be null.