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
rootName
XmlQualifiedEntityconverters
IList<XmlConverter>
Methods
CanConvert(Type)
Determines whether this instance can convert the specified object type.
public override bool CanConvert(Type objectType)
Parameters
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
XmlReaderThe XmlReader stream from which the object is deserialized.
objectType
TypeThe 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
XmlWriterThe XmlWriter stream to which the object is serialized.
value
ObjectThe object to convert.
elementName
XmlQualifiedEntityThe element name to encapsulate around
value
.
Exceptions
- InvalidOperationException
There is an error in the XML document.