mirror of
https://github.com/soukoku/ntwain.git
synced 2025-09-19 10:08:00 +08:00
change dontcare pendingxfers to static method.
This commit is contained in:
@@ -2426,9 +2426,9 @@ namespace NTwain.Data
|
|||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public struct TW_PENDINGXFERS
|
public struct TW_PENDINGXFERS
|
||||||
{
|
{
|
||||||
public TW_PENDINGXFERS()
|
public static TW_PENDINGXFERS DONTCARE()
|
||||||
{
|
{
|
||||||
Count = -1;
|
return new TW_PENDINGXFERS { Count = -1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
public short Count;
|
public short Count;
|
||||||
|
@@ -60,7 +60,7 @@ namespace NTwain
|
|||||||
if (xferImage) imgXferMech = Caps.ICAP_XFERMECH.GetCurrent().FirstOrDefault();
|
if (xferImage) imgXferMech = Caps.ICAP_XFERMECH.GetCurrent().FirstOrDefault();
|
||||||
else if (xferAudio) audXferMech = Caps.ACAP_XFERMECH.GetCurrent().FirstOrDefault();
|
else if (xferAudio) audXferMech = Caps.ACAP_XFERMECH.GetCurrent().FirstOrDefault();
|
||||||
|
|
||||||
TW_PENDINGXFERS pending = new TW_PENDINGXFERS();
|
TW_PENDINGXFERS pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
var sts = WrapInSTS(DGControl.PendingXfers.Get(ref _appIdentity, ref _currentDS, ref pending));
|
var sts = WrapInSTS(DGControl.PendingXfers.Get(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS)
|
if (sts.RC == TWRC.SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -76,13 +76,13 @@ namespace NTwain
|
|||||||
if (readyArgs.Cancel == CancelType.EndNow || _closeDsRequested)
|
if (readyArgs.Cancel == CancelType.EndNow || _closeDsRequested)
|
||||||
{
|
{
|
||||||
// TODO: need to call EndXfer first?
|
// TODO: need to call EndXfer first?
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.Reset(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.Reset(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS && xferImage) State = STATE.S5;
|
if (sts.RC == TWRC.SUCCESS && xferImage) State = STATE.S5;
|
||||||
}
|
}
|
||||||
else if (readyArgs.Cancel == CancelType.SkipCurrent)
|
else if (readyArgs.Cancel == CancelType.SkipCurrent)
|
||||||
{
|
{
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS)
|
if (sts.RC == TWRC.SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -101,7 +101,7 @@ namespace NTwain
|
|||||||
if (readyArgs.Cancel == CancelType.Graceful)
|
if (readyArgs.Cancel == CancelType.Graceful)
|
||||||
{
|
{
|
||||||
// ignore rc in this and continue transfer as normal
|
// ignore rc in this and continue transfer as normal
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
DGControl.PendingXfers.StopFeeder(ref _appIdentity, ref _currentDS, ref pending);
|
DGControl.PendingXfers.StopFeeder(ref _appIdentity, ref _currentDS, ref pending);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,9 +180,9 @@ namespace NTwain
|
|||||||
TransferCanceled?.Invoke(this, new TransferCanceledEventArgs());
|
TransferCanceled?.Invoke(this, new TransferCanceledEventArgs());
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.Reset(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.Reset(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS) State = STATE.S5;
|
if (sts.RC == TWRC.SUCCESS) State = STATE.S5;
|
||||||
break;
|
break;
|
||||||
@@ -197,7 +197,7 @@ namespace NTwain
|
|||||||
case TWCC.NOMEDIA:
|
case TWCC.NOMEDIA:
|
||||||
case TWCC.PAPERDOUBLEFEED:
|
case TWCC.PAPERDOUBLEFEED:
|
||||||
case TWCC.PAPERJAM:
|
case TWCC.PAPERJAM:
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
break;
|
break;
|
||||||
case TWCC.OPERATIONERROR:
|
case TWCC.OPERATIONERROR:
|
||||||
@@ -205,9 +205,9 @@ namespace NTwain
|
|||||||
if (_userInterface.ShowUI == 0 && indicators == TW_BOOL.False)
|
if (_userInterface.ShowUI == 0 && indicators == TW_BOOL.False)
|
||||||
{
|
{
|
||||||
// todo: alert user and drop to S4
|
// todo: alert user and drop to S4
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.Reset(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.Reset(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -236,7 +236,7 @@ namespace NTwain
|
|||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS)
|
if (sts.RC == TWRC.SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -276,7 +276,7 @@ namespace NTwain
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS)
|
if (sts.RC == TWRC.SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -360,7 +360,7 @@ namespace NTwain
|
|||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
var sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
var sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS)
|
if (sts.RC == TWRC.SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -438,7 +438,7 @@ namespace NTwain
|
|||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
var sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
var sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS)
|
if (sts.RC == TWRC.SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -467,7 +467,7 @@ namespace NTwain
|
|||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS)
|
if (sts.RC == TWRC.SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -521,7 +521,7 @@ namespace NTwain
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pending = new TW_PENDINGXFERS();
|
pending = TW_PENDINGXFERS.DONTCARE();
|
||||||
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
sts = WrapInSTS(DGControl.PendingXfers.EndXfer(ref _appIdentity, ref _currentDS, ref pending));
|
||||||
if (sts.RC == TWRC.SUCCESS)
|
if (sts.RC == TWRC.SUCCESS)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user