Made it possible to create event args externally for testing.

This commit is contained in:
soukoku
2014-09-12 07:16:10 -04:00
parent 81710b7e99
commit 0cd02ac16e
10 changed files with 245 additions and 161 deletions

View File

@@ -8,13 +8,33 @@ namespace NTwain
/// </summary>
public class TransferErrorEventArgs : EventArgs
{
/// <summary>
/// Initializes a new instance of the <see cref="TransferErrorEventArgs"/> class.
/// </summary>
/// <param name="error">The error.</param>
public TransferErrorEventArgs(Exception error)
{
Exception = error;
}
/// <summary>
/// Initializes a new instance of the <see cref="TransferErrorEventArgs"/> class.
/// </summary>
/// <param name="code">The code.</param>
/// <param name="status">The status.</param>
public TransferErrorEventArgs(ReturnCode code, TWStatus status)
{
ReturnCode = code;
SourceStatus = status;
}
/// <summary>
/// Gets the return code from the transfer.
/// </summary>
/// <value>
/// The return code.
/// </value>
public ReturnCode ReturnCode { get; internal set; }
public ReturnCode ReturnCode { get; private set; }
/// <summary>
/// Gets the source status.
@@ -22,7 +42,7 @@ namespace NTwain
/// <value>
/// The source status.
/// </value>
public TWStatus SourceStatus { get; internal set; }
public TWStatus SourceStatus { get; private set; }
/// <summary>
/// Gets the exception if the error is from some exception.
@@ -30,6 +50,6 @@ namespace NTwain
/// <value>
/// The exception.
/// </value>
public Exception Exception { get; internal set; }
public Exception Exception { get; private set; }
}
}