/// <summary> /// Initializes a new instance of the <see cref="MapiException"/> class with the specified /// error message and MAPI error code.</summary> /// <param name="code"> /// The code of the MAPI or Simple MAPI error that caused the exception.</param> /// <param name="message"> /// The error message that specifies the reason for the exception.</param> /// <remarks><para> /// The following table shows the initial property values for the new instance of <see /// cref="MapiException"/>: /// </para><list type="table"><listheader> /// <term>Property</term><description>Value</description> /// </listheader><item> /// <term><see cref="Code"/></term> /// <description>The specified <paramref name="code"/> which should be one of the error /// codes defined in <see cref="Win32Api.MapiError"/>.</description> /// </item><item> /// <term><see cref="Exception.InnerException"/></term> /// <description>A null reference.</description> /// </item><item> /// <term><see cref="Exception.Message"/></term> /// <description>The specified <paramref name="message"/>.</description> /// </item></list></remarks> public MapiException(Win32Api.MapiError code, string message) : base(message) { _code = code; }
/// <summary> /// Initializes a new instance of the <see cref="MapiException"/> class with the specified /// error message and MAPI error code, and with the previous exception that is the cause of /// this <see cref="MapiException"/>.</summary> /// <param name="code"> /// The code of the MAPI or Simple MAPI error that caused the exception.</param> /// <param name="message"> /// The error message that specifies the reason for the exception.</param> /// <param name="innerException"> /// The previous <see cref="Exception"/> that is the cause of the current <see /// cref="MapiException"/>.</param> /// <remarks><para> /// The following table shows the initial property values for the new instance of <see /// cref="MapiException"/>: /// </para><list type="table"><listheader> /// <term>Property</term><description>Value</description> /// </listheader><item> /// <term><see cref="Code"/></term> /// <description>The specified <paramref name="code"/> which should be one of the error /// codes defined in <see cref="Win32Api.MapiError"/>.</description> /// </item><item> /// <term><see cref="Exception.InnerException"/></term> /// <description>The specified <paramref name="innerException"/>.</description> /// </item><item> /// <term><see cref="Exception.Message"/></term> /// <description>The specified <paramref name="message"/>.</description> /// </item></list></remarks> public MapiException(Win32Api.MapiError code, string message, Exception innerException) : base(message, innerException) { _code = code; }
/// <summary> /// Initializes a new instance of the <see cref="MapiException"/> class with the specified /// MAPI error code.</summary> /// <param name="code"> /// The code of the MAPI or Simple MAPI error that caused the exception.</param> /// <remarks><para> /// The following table shows the initial property values for the new instance of <see /// cref="MapiException"/>: /// </para><list type="table"><listheader> /// <term>Property</term><description>Value</description> /// </listheader><item> /// <term><see cref="Code"/></term> /// <description>The specified <paramref name="code"/> which should be one of the error /// codes defined in <see cref="Win32Api.MapiError"/>.</description> /// </item><item> /// <term><see cref="Exception.InnerException"/></term> /// <description>A null reference.</description> /// </item><item> /// <term><see cref="Exception.Message"/></term> /// <description>A localized description of the specified <paramref name="code"/>, followed /// by the numerical <paramref name="code"/> itself.</description> /// </item></list></remarks> public MapiException(Win32Api.MapiError code) : base(MapiMail.GetErrorStringAndCode(code)) { _code = code; }