mirror of
https://github.com/soukoku/ntwain.git
synced 2025-04-05 20:59:23 +08:00
Updated with suggestion from #63.
This commit is contained in:
parent
7659c6ac95
commit
0e3d7fd1e9
@ -94,6 +94,15 @@ namespace NTwain
|
||||
/// </value>
|
||||
bool StopOnTransferError { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the reason a source was disabled (dropped from state 5) if it's due to user action.
|
||||
/// Mostly only <see cref="Message.CloseDSOK"/> or <see cref="Message.CloseDSReq"/>.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The dialog result.
|
||||
/// </value>
|
||||
Message DisableReason { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Try to show the built-in source selector dialog and return the selected source.
|
||||
/// This is not recommended and is only included for completeness.
|
||||
|
@ -23,7 +23,7 @@ namespace NTwain
|
||||
/// <summary>
|
||||
/// The build release version number.
|
||||
/// </summary>
|
||||
public const string Build = "3.3.9.4"; // change this for each nuget release
|
||||
public const string Build = "3.3.9.5"; // change this for each nuget release
|
||||
|
||||
|
||||
}
|
||||
|
@ -211,6 +211,15 @@ namespace NTwain
|
||||
/// </value>
|
||||
public bool StopOnTransferError { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the reason a source was disabled (dropped from state 5) if it's due to user action.
|
||||
/// Mostly only <see cref="Message.CloseDSOK" /> or <see cref="Message.CloseDSReq" />.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The dialog result.
|
||||
/// </value>
|
||||
public Message DisableReason { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Opens the data source manager. This must be the first method used
|
||||
/// before using other TWAIN functions. Calls to this must be followed by
|
||||
|
@ -159,6 +159,7 @@ namespace NTwain
|
||||
ReturnCode ITwainSessionInternal.EnableSource(SourceEnableMode mode, bool modal, IntPtr windowHandle)
|
||||
{
|
||||
_closeRequested = false;
|
||||
DisableReason = Message.Null;
|
||||
var rc = ReturnCode.Failure;
|
||||
|
||||
_msgLoopHook.Invoke(() =>
|
||||
@ -306,6 +307,7 @@ namespace NTwain
|
||||
break;
|
||||
case Message.CloseDSReq:
|
||||
case Message.CloseDSOK:
|
||||
DisableReason = msg;
|
||||
// even though it says closeDS it's really disable.
|
||||
// dsok is sent if source is enabled with uionly
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user