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
-
DefaultXmlConverter
- Inherited Members
Constructors
DefaultXmlConverter(XmlQualifiedEntity, IList<XmlConverter>)
Initializes a new instance of the DefaultXmlConverter class.
public DefaultXmlConverter(XmlQualifiedEntity rootName, IList<XmlConverter> converters)
Parameters
rootNameXmlQualifiedEntityconvertersIList<XmlConverter>
Methods
CanConvert(Type)
Determines whether this instance can convert the specified object type.
public override bool CanConvert(Type objectType)
Parameters
Returns
- bool
trueif 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
readerXmlReaderThe XmlReader stream from which the object is deserialized.
objectTypeTypeThe 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
writerXmlWriterThe XmlWriter stream to which the object is serialized.
valueobjectThe object to convert.
elementNameXmlQualifiedEntityThe element name to encapsulate around
value.
Exceptions
- InvalidOperationException
There is an error in the XML document.