Table of Contents

Class DefaultXmlConverter

Namespace
Cuemon.Xml.Serialization.Converters
Assembly
Cuemon.Xml.dll

Provides a default way to convert objects to and from XML.

public sealed class DefaultXmlConverter : XmlConverter
Inheritance
Object
DefaultXmlConverter
Inherited Members

Constructors

DefaultXmlConverter(XmlQualifiedEntity, IList<XmlConverter>)

Initializes a new instance of the DefaultXmlConverter class.

public DefaultXmlConverter(XmlQualifiedEntity rootName, IList<XmlConverter> converters)

Parameters

rootName XmlQualifiedEntity
converters IList<XmlConverter>

Methods

CanConvert(Type)

Determines whether this instance can convert the specified object type.

public override bool CanConvert(Type objectType)

Parameters

objectType Type

The System.Type of the object.

Returns

Boolean

true if this instance can convert the specified object type; otherwise, false.

ReadXml(XmlReader, Type)

Generates an object from its XML representation.

public override object ReadXml(XmlReader reader, Type objectType)

Parameters

reader XmlReader

The System.Xml.XmlReader stream from which the object is deserialized.

objectType Type

The System.Type of the object to generate.

Returns

Object

The generated (deserialized) object.

WriteXml(XmlWriter, Object, XmlQualifiedEntity)

Converts an object into its XML representation.

public override void WriteXml(XmlWriter writer, object value, XmlQualifiedEntity elementName = null)

Parameters

writer XmlWriter

The System.Xml.XmlWriter stream to which the object is serialized.

value Object

The object to convert.

elementName XmlQualifiedEntity

The element name to encapsulate around value.

Exceptions

System.InvalidOperationException

There is an error in the XML document.