Class ExceptionConverter
- Namespace
- Cuemon.Xml.Serialization.Converters
- Assembly
- Cuemon.Xml.dll
Converts an System.Exception to XML.
public class ExceptionConverter : XmlConverter<Exception>
- Inheritance
-
ObjectXmlConverter<Exception>ExceptionConverter
- Inherited Members
Constructors
ExceptionConverter(Boolean, Boolean)
Initializes a new instance of the ExceptionConverter class.
public ExceptionConverter(bool includeStackTrace = false, bool includeData = false)
Parameters
includeStackTrace
BooleanA value that indicates if the stack of an exception is included in the converted result.
includeData
BooleanA value that indicates if the data of an exception is included in the converted result.
Properties
IncludeData
Gets a value indicating whether the data of an exception is included in the converted result.
public bool IncludeData { get; }
Property Value
- Boolean
true
if the data of an exception is included in the converted result; otherwise,false
.
IncludeStackTrace
Gets a value indicating whether the stack of an exception is included in the converted result.
public bool IncludeStackTrace { get; }
Property Value
- Boolean
true
if the stack of an exception is included in the converted result; otherwise,false
.
Methods
ReadXml(XmlReader, Type)
Reads the XML representation of the objectType
.
public override object ReadXml(XmlReader reader, Type objectType)
Parameters
reader
XmlReaderThe System.Xml.XmlReader to read from.
objectType
TypeThe System.Type of the object.
Returns
- Object
An object of
objectType
.
WriteXml(XmlWriter, Object, XmlQualifiedEntity)
Writes the XML representation of the value
.
public override void WriteXml(XmlWriter writer, object value, XmlQualifiedEntity elementName = null)
Parameters
writer
XmlWriterThe System.Xml.XmlWriter to write to.
value
ObjectThe object to serialize.
elementName
XmlQualifiedEntityThe element name to encapsulate around
value
.