Class DefaultXmlConverter
Provides a default way to convert objects to and from XML.
Namespace: Cuemon.Serialization.Xml.Converters
Assembly: Cuemon.Serialization.Xml.dll
Syntax
public sealed class DefaultXmlConverter : XmlConverter
Constructors
| Improve this DocDefaultXmlConverter(XmlQualifiedEntity, IList<XmlConverter>)
Initializes a new instance of the DefaultXmlConverter class.
Declaration
public DefaultXmlConverter(XmlQualifiedEntity rootName, IList<XmlConverter> converters)
Parameters
Type | Name | Description |
---|---|---|
XmlQualifiedEntity | rootName | |
System.Collections.Generic.IList<XmlConverter> | converters |
Methods
| Improve this DocCanConvert(Type)
Determines whether this instance can convert the specified object type.
Declaration
public override bool CanConvert(Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | objectType | The System.Type of the object. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
| Improve this DocReadXml(XmlReader, Type)
Generates an object from its XML representation.
Declaration
public override object ReadXml(XmlReader reader, Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | The System.Xml.XmlReader stream from which the object is deserialized. |
System.Type | objectType | The System.Type of the object to generate. |
Returns
Type | Description |
---|---|
System.Object | The generated (deserialized) object. |
Overrides
| Improve this DocWriteXml(XmlWriter, Object, XmlQualifiedEntity)
Converts an object into its XML representation.
Declaration
public override void WriteXml(XmlWriter writer, object value, XmlQualifiedEntity elementName = null)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | The System.Xml.XmlWriter stream to which the object is serialized. |
System.Object | value | The object to convert. |
XmlQualifiedEntity | elementName | The element name to encapsulate around |
Overrides
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | There is an error in the XML document. |