Class XmlSerializer
- Namespace
- Cuemon.Xml.Serialization
- Assembly
- Cuemon.Xml.dll
Serializes and deserializes objects into and from the XML format.
public class XmlSerializer
- Inheritance
-
XmlSerializer
Methods
Create(XmlSerializerOptions)
Creates a new XmlSerializer instance using the specified XmlSerializerOptions.
public static XmlSerializer Create(XmlSerializerOptions settings)
Parameters
settingsXmlSerializerOptionsThe settings to be applied to the XmlSerializer.
Returns
- XmlSerializer
A new XmlSerializer instance using the specified XmlSerializerOptions.
Remarks
If settings is null, DefaultSettings is tried invoked. Otherwise, as a fallback, a default instance of XmlSerializerOptions is created.
Deserialize(Stream, Type)
Deserializes the specified value into an object of objectType.
public object Deserialize(Stream value, Type objectType)
Parameters
valueStreamThe object to deserialize from XML format.
objectTypeTypeThe type of the object to deserialize.
Returns
- object
An object of
objectType.
Deserialize<T>(Stream)
Deserializes the specified value into an object of T.
public T Deserialize<T>(Stream value)
Parameters
valueStreamThe object to deserialize from XML format.
Returns
- T
An object of
T.
Type Parameters
TThe type of the object to deserialize.
Serialize(object, Type)
Serializes the specified value to a Stream.
public Stream Serialize(object value, Type objectType)
Parameters
valueobjectThe object to serialize to XML format.
objectTypeTypeThe type of the object to serialize.
Returns
- Stream
A stream of the serialized object.