System.Xml.Serialization.XmlSerializer Members

The members of System.Xml.Serialization.XmlSerializer are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new instance of the System.Xml.Serialization.XmlSerializer class that can serialize objects of the specified type into XML documents, and deserialize XML documents into objects of the specified type.

Initializes an instance of the System.Xml.Serialization.XmlSerializer class using an object that maps one type to another.

Initializes a new instance of the System.Xml.Serialization.XmlSerializer class that can serialize objects of the specified type into XML documents, and deserialize XML documents into objects of the specified type. Specifies the default namespace for all the XML elements.

Initializes a new instance of the System.Xml.Serialization.XmlSerializer class that can serialize objects of the specified type into XML documents, and deserialize XML documents into object of a specified type. If a property or field returns an array, the extraTypes parameter specifies objects that can be inserted into the array.

Initializes a new instance of the System.Xml.Serialization.XmlSerializer class that can serialize objects of the specified type into XML documents, and deserialize XML documents into objects of the specified type. Each object to be serialized can itself contain instances of classes, which this overload can override with other classes.

Initializes a new instance of the System.Xml.Serialization.XmlSerializer class that can serialize objects of the specified type into XML documents, and deserialize an XML document into object of the specified type. It also specifies the class to use as the XML root element.

Initializes a new instance of the System.Xml.Serialization.XmlSerializer class that can serialize objects of type object into XML document instances, and deserialize XML document instances into objects of type object. Each object to be serialized can itself contain instances of classes, which this overload overrides 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.

Initializes a new instance of the System.Xml.Serialization.XmlSerializer class that can serialize objects of the specified type into XML document instances, and deserialize XML document instances into objects of the specified type. This overload allows you to supply other types that can be encountered during a serialization or deserialization operation, as well as a default namespace for all XML elements, the class to use as the XML root element, its location, and credentials required for access.

Protected Constructors

Initializes a new instance of the System.Xml.Serialization.XmlSerializer class.

Public Methods

CanDeserialize(System.Xml.XmlReader) : bool

Gets a value that indicates whether this System.Xml.Serialization.XmlSerializer can deserialize a specified XML document.

Deserialize(System.IO.Stream) : object

Deserializes the XML document contained by the specified System.IO.Stream.

Deserialize(System.IO.TextReader) : object

Deserializes the XML document contained by the specified System.IO.TextReader.

Deserialize(System.Xml.XmlReader) : object

Deserializes the XML document contained by the specified System.xml.XmlReader.

Deserialize(System.Xml.XmlReader, string) : object

Deserializes the XML document contained by the specified System.xml.XmlReader and encoding style.

Deserialize(System.Xml.XmlReader, XmlDeserializationEvents) : object

Deserializes an XML document contained by the specified System.Xml.XmlReader and allows the overriding of events that occur during deserialization.

Deserialize(System.Xml.XmlReader, string, XmlDeserializationEvents) : object

Deserializes the object using the data contained by the specified System.Xml.XmlReader.

static
FromMappings(XmlMapping[]) : XmlSerializer[]

Returns an array of System.Xml.Serialization.XmlSerializer objects created from an array of System.Xml.Serialization.XmlTypeMapping objects.

static
FromMappings(XmlMapping[], System.Security.Policy.Evidence) : XmlSerializer[]

Returns an instance of the System.Xml.Serialization.XmlSerializer class created from mappings of one XML type to another.

static
FromMappings(XmlMapping[], Type) : XmlSerializer[]

Returns an instance of the System.Xml.Serialization.XmlSerializer class from the specified mappings.

static
FromTypes(Type[]) : XmlSerializer[]

Returns an array of System.Xml.Serialization.XmlSerializer objects created from an array of types.

static
GenerateSerializer(Type[], XmlMapping[]) : System.Reflection.Assembly

Returns an assembly that contains custom-made serializers used to serialize or deserialize the specified type or types, using the specified mappings.

static
GenerateSerializer(Type[], XmlMapping[], System.CodeDom.Compiler.CompilerParameters) : System.Reflection.Assembly

Returns an assembly that contains custom-made serializers used to serialize or deserialize the specified type or types, using the specified mappings and compiler settings and options.

static
GetXmlSerializerAssemblyName(Type) : string

Returns the name of the assembly that contains one or more versions of the System.Xml.Serialization.XmlSerializer especially created to serialize or deserialize the specified type.

static
GetXmlSerializerAssemblyName(Type, string) : string

Returns the name of the assembly that contains the serializer for the specified type in the specified namespace.

Serialize(System.IO.Stream, object)

Serializes the specified object and writes the XML document to a file using the specified System.IO.Stream.

Serialize(System.IO.TextWriter, object)

Serializes the specified object and writes the XML document to a file using the specified System.IO.TextWriter.

Serialize(System.Xml.XmlWriter, object)

Serializes the specified object and writes the XML document to a file using the specified System.Xml.XmlWriter.

Serialize(System.IO.Stream, object, XmlSerializerNamespaces)

Serializes the specified object and writes the XML document to a file using the specified System.IO.Streamthat references the specified namespaces.

Serialize(System.IO.TextWriter, object, XmlSerializerNamespaces)

Serializes the specified object and writes the XML document to a file using the specified System.IO.TextWriter and references the specified namespaces.

Serialize(System.Xml.XmlWriter, object, XmlSerializerNamespaces)

Serializes the specified object and writes the XML document to a file using the specified System.Xml.XmlWriter and references the specified namespaces.

Serialize(System.Xml.XmlWriter, object, XmlSerializerNamespaces, string)

Serializes the specified object and writes the XML document to a file using the specified System.Xml.XmlWriter and references the specified namespaces and encoding style.

Serialize(System.Xml.XmlWriter, object, XmlSerializerNamespaces, string, string)

Serializes the specified object and writes the XML document to a file using the specified System.Xml.XmlWriter, XML namespaces, and encoding.

Protected Methods

CreateReader() : XmlSerializationReader

Returns an object used to read the XML document to be serialized.

CreateWriter() : XmlSerializationWriter

When overridden in a derived class, returns a writer used to serialize the object.

Deserialize(XmlSerializationReader) : object

Deserializes the XML document contained by the specified System.Xml.Serialization.XmlSerializationReader.

Serialize(object, XmlSerializationWriter)

Serializes the specified object and writes the XML document to a file using the specified System.Xml.Serialization.XmlSerializationWriter.

Public Events

UnknownAttribute

Occurs when the System.Xml.Serialization.XmlSerializer encounters an XML attribute of unknown type during deserialization.

UnknownElement

Occurs when the System.Xml.Serialization.XmlSerializer encounters an XML element of unknown type during deserialization.

UnknownNode

Occurs when the System.Xml.Serialization.XmlSerializer encounters an XML node of unknown type during deserialization.

UnreferencedObject

Occurs during deserialization of a SOAP-encoded XML stream, when the System.Xml.Serialization.XmlSerializer encounters a recognized type that is not used or is unreferenced.