Class XmlSerializer
Serializes and deserializes objects into and from the XML format.
Inheritance
Namespace: Cuemon.Serialization.Xml
Assembly: Cuemon.Serialization.Xml.dll
Syntax
public class XmlSerializer
Methods
| Improve this DocCreate(XmlSerializerSettings)
Creates a new XmlSerializer instance using the specified XmlSerializerSettings.
Declaration
public static XmlSerializer Create(XmlSerializerSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlSerializerSettings | settings | The settings to be applied to the XmlSerializer. |
Returns
| Type | Description |
|---|---|
| XmlSerializer | A new XmlSerializer instance using the specified XmlSerializerSettings. |
Remarks
If settings is null, DefaultSettings is tried invoked. Otherwise, as a fallback, a default instance of XmlSerializerSettings is created.
Deserialize(Stream, Type)
Deserializes the specified value into an object of objectType.
Declaration
public object Deserialize(Stream value, Type objectType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | value | The object to deserialize from XML format. |
| System.Type | objectType | The type of the object to deserialize. |
Returns
| Type | Description |
|---|---|
| System.Object | An object of |
Deserialize<T>(Stream)
Deserializes the specified value into an object of T.
Declaration
public T Deserialize<T>(Stream value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | value | The object to deserialize from XML format. |
Returns
| Type | Description |
|---|---|
| T | An object of |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the object to deserialize. |
Serialize(Object, Type)
Serializes the specified value to a System.IO.Stream.
Declaration
public Stream Serialize(object value, Type objectType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | The object to serialize to XML format. |
| System.Type | objectType | The type of the object to serialize. |
Returns
| Type | Description |
|---|---|
| System.IO.Stream | A stream of the serialized object. |