Class ExceptionConverter
- Namespace
- Cuemon.Xml.Serialization.Converters
- Assembly
- Cuemon.Xml.dll
Converts an Exception to XML.
public class ExceptionConverter : XmlConverter<Exception>
- Inheritance
-
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(Type, XmlReader)
Reads the XML representation of the objectType
.
public override Exception ReadXml(Type objectType, XmlReader reader)
Parameters
Returns
- Exception
An object of
objectType
.
WriteXml(XmlWriter, Exception, XmlQualifiedEntity)
Writes the XML representation of the value
.
public override void WriteXml(XmlWriter writer, Exception value, XmlQualifiedEntity elementName = null)
Parameters
writer
XmlWriterThe XmlWriter to write to.
value
ExceptionThe object to serialize.
elementName
XmlQualifiedEntityThe element name to encapsulate around
value
.