C# Class CK.Core.CKExceptionData

Show file Open project: Invenietis/ck-core Class Usage Examples

Public Properties

Property Type Description
CurrentStreamVersion int

Public Methods

Method Description
CKExceptionData ( CKBinaryReader r, bool streamIsCRLF ) : System

Initializes a new CKExceptionData from a CKBinaryReader. See Write(CKBinaryWriter,bool).

CKExceptionData ( CKBinaryReader r, bool streamIsCRLF, int version ) : System

Initializes a new CKExceptionData from a CKBinaryReader with a known version. See Write(CKBinaryWriter,bool).

CKExceptionData ( string message, string exceptionTypeName, string exceptionTypeAssemblyQualifiedName, string stackTrace, CKExceptionData innerException, string fileName, string detailedInfo, CKExceptionData loaderExceptions, CKExceptionData aggregatedExceptions ) : System

Initializes a new CKExceptionData with all its fields. Use the factory method CreateFrom to create a data from any exception.

CreateFrom ( Exception ex ) : CKExceptionData

Creates a CKExceptionData from any Exception.

ToString ( ) : string

Overridden to return a detailed text. This string is cached once built.

ToStringBuilder ( StringBuilder b, string prefix ) : void

Writes the exception data as a readable block of text into a StringBuilder.

ToTextWriter ( TextWriter w, string prefix ) : void

Writes the exception data as a readable block of text into a TextWriter.

Write ( CKBinaryWriter w, bool writeVersion = true ) : void

Writes this exception data into a BinaryWriter.

Private Methods

Method Description
AppendField ( StringBuilder b, string prefix, string label, string text ) : StringBuilder
WriteWithoutVersion ( CKBinaryWriter w ) : void

Method Details

CKExceptionData() public method

Initializes a new CKExceptionData from a CKBinaryReader. See Write(CKBinaryWriter,bool).
public CKExceptionData ( CKBinaryReader r, bool streamIsCRLF ) : System
r CKBinaryReader The reader to read from.
streamIsCRLF bool Whether the strings have CRLF or LF for end-of-lines.
return System

CKExceptionData() public method

Initializes a new CKExceptionData from a CKBinaryReader with a known version. See Write(CKBinaryWriter,bool).
public CKExceptionData ( CKBinaryReader r, bool streamIsCRLF, int version ) : System
r CKBinaryReader The reader to read from.
streamIsCRLF bool Whether the strings have CRLF or LF for end-of-lines.
version int Known version.
return System

CKExceptionData() public method

Initializes a new CKExceptionData with all its fields. Use the factory method CreateFrom to create a data from any exception.
public CKExceptionData ( string message, string exceptionTypeName, string exceptionTypeAssemblyQualifiedName, string stackTrace, CKExceptionData innerException, string fileName, string detailedInfo, CKExceptionData loaderExceptions, CKExceptionData aggregatedExceptions ) : System
message string Message of the exception. Must not be null.
exceptionTypeName string Type name of the exception (no namespace nor assembly). Must not be null nor empty..
exceptionTypeAssemblyQualifiedName string Full type name of the exception. Must not be null nor empty.
stackTrace string Stack trace. Can be null.
innerException CKExceptionData Inner exception. If is not null, it must be the same as the first aggregated exceptions.
fileName string File name related to the exception (if it makes sense). Can be null.
detailedInfo string More detailed information if any.
loaderExceptions CKExceptionData Loader exceptions. .
aggregatedExceptions CKExceptionData Aggregated exceptions can be null. Otherwise, it must contain at least one exception.
return System

CreateFrom() static public method

Creates a CKExceptionData from any Exception.
static public CreateFrom ( Exception ex ) : CKExceptionData
ex System.Exception Exception for which data must be created. Can be null: null is returned.
return CKExceptionData

ToString() public method

Overridden to return a detailed text. This string is cached once built.
public ToString ( ) : string
return string

ToStringBuilder() public method

Writes the exception data as a readable block of text into a StringBuilder.
public ToStringBuilder ( StringBuilder b, string prefix ) : void
b StringBuilder The StringBuilder to write to.
prefix string Prefix that will appear at the start of each line.
return void

ToTextWriter() public method

Writes the exception data as a readable block of text into a TextWriter.
public ToTextWriter ( TextWriter w, string prefix ) : void
w System.IO.TextWriter The TextWriter to write to.
prefix string Prefix that will appear at the start of each line.
return void

Write() public method

Writes this exception data into a BinaryWriter.
public Write ( CKBinaryWriter w, bool writeVersion = true ) : void
w CKBinaryWriter The writer to use. Can not be null.
writeVersion bool False to not write the .
return void

Property Details

CurrentStreamVersion public static property

The current stream version.
public static int CurrentStreamVersion
return int