mirror of
https://github.com/soukoku/ntwain.git
synced 2025-09-19 01:57:56 +08:00
Made it possible to create event args externally for testing.
This commit is contained in:
@@ -8,6 +8,37 @@ namespace NTwain
|
||||
/// </summary>
|
||||
public class DataTransferredEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DataTransferredEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="nativeData">The native data.</param>
|
||||
/// <param name="imageInfo">The image information.</param>
|
||||
public DataTransferredEventArgs(IntPtr nativeData, TWImageInfo imageInfo)
|
||||
{
|
||||
NativeData = nativeData;
|
||||
ImageInfo = imageInfo;
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DataTransferredEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="fileDataPath">The file data path.</param>
|
||||
/// <param name="imageInfo">The image information.</param>
|
||||
public DataTransferredEventArgs(string fileDataPath, TWImageInfo imageInfo)
|
||||
{
|
||||
FileDataPath = fileDataPath;
|
||||
ImageInfo = imageInfo;
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DataTransferredEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="memoryData">The memory data.</param>
|
||||
/// <param name="imageInfo">The image information.</param>
|
||||
public DataTransferredEventArgs(byte[] memoryData, TWImageInfo imageInfo)
|
||||
{
|
||||
MemoryData = memoryData;
|
||||
ImageInfo = imageInfo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets pointer to the complete data if the transfer was native.
|
||||
/// The data will be freed once the event handler ends
|
||||
@@ -16,7 +47,7 @@ namespace NTwain
|
||||
/// This pointer is already locked for the duration of this event.
|
||||
/// </summary>
|
||||
/// <value>The data pointer.</value>
|
||||
public IntPtr NativeData { get; internal set; }
|
||||
public IntPtr NativeData { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file path to the complete data if the transfer was file or memory-file.
|
||||
@@ -24,7 +55,7 @@ namespace NTwain
|
||||
/// <value>
|
||||
/// The file path.
|
||||
/// </value>
|
||||
public string FileDataPath { get; internal set; }
|
||||
public string FileDataPath { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the raw memory data if the transfer was memory.
|
||||
@@ -35,7 +66,7 @@ namespace NTwain
|
||||
/// The memory data.
|
||||
/// </value>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
|
||||
public byte[] MemoryData { get; internal set; }
|
||||
public byte[] MemoryData { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the final image information if applicable.
|
||||
@@ -43,7 +74,7 @@ namespace NTwain
|
||||
/// <value>
|
||||
/// The final image information.
|
||||
/// </value>
|
||||
public TWImageInfo ImageInfo { get; internal set; }
|
||||
public TWImageInfo ImageInfo { get; private set; }
|
||||
|
||||
///// <summary>
|
||||
///// Gets the extended image information if applicable.
|
||||
|
Reference in New Issue
Block a user