Exposes actual EndXferJob value during transfer ready event. May help #56.

This commit is contained in:
Eugene Wang
2016-02-15 19:33:22 -05:00
parent 86bf6efe34
commit 870ecd64a4
8 changed files with 45 additions and 20 deletions

View File

@@ -2129,7 +2129,7 @@ namespace NTwain.Data
/// than None. If this is not 0, the application should expect more data
/// from the driver according to CapJobControl settings.
/// </summary>
public uint EndOfJob { get { return _eOJ; } }
public EndXferJob EndOfJob { get { return (EndXferJob)_eOJ; } }
}

View File

@@ -49,7 +49,7 @@ namespace NTwain.Internals
{
#region raise xfer ready
var preXferArgs = new TransferReadyEventArgs(session.CurrentSource, pending.Count, pending.EndOfJob == 0); ;
var preXferArgs = new TransferReadyEventArgs(session.CurrentSource, pending.Count, pending.EndOfJob); ;
session.SafeSyncableRaiseEvent(preXferArgs);
#endregion

View File

@@ -1,6 +1,6 @@
using System.Reflection;
[assembly: AssemblyCopyright("Copyright \x00a9 Yin-Chun Wang 2012-2015")]
[assembly: AssemblyCopyright("Copyright \x00a9 Yin-Chun Wang 2012-2016")]
[assembly: AssemblyCompany("Yin-Chun Wang")]
[assembly: AssemblyVersion(NTwain.VersionInfo.Release)]
@@ -23,7 +23,7 @@ namespace NTwain
/// <summary>
/// The build release version number.
/// </summary>
public const string Build = "3.3.7"; // change this for each nuget release
public const string Build = "3.3.8"; // change this for each nuget release
}

View File

@@ -13,12 +13,12 @@ namespace NTwain
/// </summary>
/// <param name="source">The source.</param>
/// <param name="pendingCount">The pending count.</param>
/// <param name="endOfJob">if set to <c>true</c> then it's the end of job.</param>
public TransferReadyEventArgs(DataSource source, int pendingCount, bool endOfJob)
/// <param name="endOfJobFlag"></param>
public TransferReadyEventArgs(DataSource source, int pendingCount, EndXferJob endOfJobFlag)
{
DataSource = source;
PendingTransferCount = pendingCount;
EndOfJob = endOfJob;
EndOfJobFlag = endOfJobFlag;
}
/// <summary>
@@ -46,7 +46,15 @@ namespace NTwain
/// Gets a value indicating whether current transfer signifies an end of job in TWAIN world.
/// </summary>
/// <value><c>true</c> if transfer is end of job; otherwise, <c>false</c>.</value>
public bool EndOfJob { get; private set; }
public bool EndOfJob { get { return EndOfJobFlag != EndXferJob.None; } }
/// <summary>
/// Gets the end of job flag value for this transfer (if job control is enabled).
/// </summary>
/// <value>
/// The end of job flag.
/// </value>
public EndXferJob EndOfJobFlag { get; private set; }
/// <summary>
/// Gets the known pending transfer count. This may not be appilicable