System.Xml.Serialization.XmlSerializerFactory.CreateSerializer Method

Returns a derivation of the System.Xml.Serialization.XmlSerializer class that can serialize objects of the specified type into XML document instances, and vice versa. Each object to be serialized can itself contain instances of classes, which this overload can override with other classes. This overload also specifies the default namespace for all the XML elements, and the class to use as the XML root element.

Syntax

public XmlSerializer CreateSerializer (Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace)

Parameters

type
The Type to serialize.
overrides
An System.Xml.Serialization.XmlAttributeOverrides that contains fields that override the default serialization behavior.
extraTypes
A Type array of additional object types to serialize.
root
An System.Xml.Serialization.XmlRootAttribute that represents the XML root element.
defaultNamespace
The default namespace of all XML elements in the XML document.

Returns

A derivation of the System.Xml.Serialization.XmlSerializer.

Remarks

Calling this overload is similar to calling the XmlSerializer.#ctor(Type, XmlAttributeOverrides, Type[], XmlRootAttribute, string) to create an instance of the System.Xml.Serialization.XmlSerializer class.

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0