.NET Portable TypeCast  3.1.0.4
A, easy-to-use tested, generic, portable, runtime-extensible, arbitrary type converter library
Core.TypeCast.ConverterException Class Reference

The Exception-type which is raised exclusively by the Converter<TIn,TOut> Library More...

+ Collaboration diagram for Core.TypeCast.ConverterException:

Public Member Functions

 ConverterException (ConverterCause cause, string message=null)
 Initializes a new instance of the ConverterException class. Requires a ConverterCause and optional user message . More...
 
 ConverterException (ConverterCause cause, Exception innerException)
 Initializes a new instance of the ConverterException class. Requires a ConverterCause and innerException message More...
 
 ConverterException (ConverterCause cause, Exception innerException, string message)
 Initializes a new instance of the ConverterException class. Requires a ConverterCause an innerException and an exception message More...
 
virtual string GetMessage ()
 Override this method for custom formatting of the unformatted exception Exception.Message More...
 
override string ToString ()
 A string representation of the current exception. More...
 

Properties

ConverterCause Cause [get, set]
 Gets or sets the exception's ConverterCause, which is set through the parameterized exception constructor ConverterException(ConverterCause, string) More...
 
override string Message [get]
 Gets the exception message. More...
 

Detailed Description

The Exception-type which is raised exclusively by the Converter<TIn,TOut> Library

See also
ConverterCause

Definition at line 19 of file ConverterException.cs.

Constructor & Destructor Documentation

Core.TypeCast.ConverterException.ConverterException ( ConverterCause  cause,
string  message = null 
)

Initializes a new instance of the ConverterException class. Requires a ConverterCause and optional user message .

Parameters
causeThe coded reason for the Exception
messageThe message for the Exception. If left empty, the description of the cause will be used as exception message

Definition at line 30 of file ConverterException.cs.

31  : this(cause, null, message ?? cause.GetDescription())
32  {
33  }
Core.TypeCast.ConverterException.ConverterException ( ConverterCause  cause,
Exception  innerException 
)

Initializes a new instance of the ConverterException class. Requires a ConverterCause and innerException message

Parameters
causeThe coded reason for the Exception
innerExceptionThe wrapped exception within the ConverterException

Definition at line 41 of file ConverterException.cs.

42  : this(cause, innerException, cause.GetDescription())
43  {
44  }
Core.TypeCast.ConverterException.ConverterException ( ConverterCause  cause,
Exception  innerException,
string  message 
)

Initializes a new instance of the ConverterException class. Requires a ConverterCause an innerException and an exception message

Parameters
causeThe coded reason for the Exception of the value ConverterCause
innerExceptionThe wrapped exception within the ConverterException
messageThe message for the Exception

Definition at line 53 of file ConverterException.cs.

54  : base(message, innerException)
55  {
56  this.Cause = cause;
57  }
ConverterCause Cause
Gets or sets the exception&#39;s ConverterCause, which is set through the parameterized exception constru...

Member Function Documentation

virtual string Core.TypeCast.ConverterException.GetMessage ( )
virtual

Override this method for custom formatting of the unformatted exception Exception.Message

Returns
The string containing the formatted exception message

Definition at line 71 of file ConverterException.cs.

72  {
73  return this.Cause.GetType().Name + " '" + this.Cause + "': " + this.Cause.GetDescription();
74  }
ConverterCause Cause
Gets or sets the exception&#39;s ConverterCause, which is set through the parameterized exception constru...
override string Core.TypeCast.ConverterException.ToString ( )

A string representation of the current exception.

Returns
Returns a string representation of GetMessage concatenated to the underlying Exception.ToString method.

Definition at line 93 of file ConverterException.cs.

94  {
95  return this.GetMessage() + Environment.NewLine + base.ToString();
96  }
virtual string GetMessage()
Override this method for custom formatting of the unformatted exception Exception.Message

Property Documentation

ConverterCause Core.TypeCast.ConverterException.Cause
getset

Gets or sets the exception's ConverterCause, which is set through the parameterized exception constructor ConverterException(ConverterCause, string)

Returns
The enumeration value for the raised Exception of the type ConverterCause

To get a detailed description of the value, use EnumExtension.GetDescription(Enum,string)

Definition at line 65 of file ConverterException.cs.

override string Core.TypeCast.ConverterException.Message
get

Gets the exception message.

Definition at line 80 of file ConverterException.cs.


The documentation for this class was generated from the following file: