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(bool, bool)
Initializes a new instance of the ExceptionConverter class.
public ExceptionConverter(bool includeStackTrace = false, bool includeData = false)
Parameters
includeStackTraceboolA value that indicates if the stack of an exception is included in the converted result.
includeDataboolA 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
- bool
trueif 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
- bool
trueif 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
writerXmlWriterThe XmlWriter to write to.
valueExceptionThe object to serialize.
elementNameXmlQualifiedEntityThe element name to encapsulate around
value.