mirror of
https://github.com/soukoku/ntwain.git
synced 2025-10-08 00:14:38 +08:00
Typos and debug msg updates.
This commit is contained in:
@@ -260,7 +260,7 @@ namespace NTwain.Data
|
||||
/// <returns></returns>
|
||||
public static TW_CAPABILITY CreateRangeCap<TValue>(this CAP cap, IMemoryManager memMgr, Range<TValue> value) where TValue : struct
|
||||
{
|
||||
TW_CAPABILITY twCap = new() { Cap = cap, ConType = TWON.ENUMERATION };
|
||||
TW_CAPABILITY twCap = new() { Cap = cap, ConType = TWON.RANGE };
|
||||
|
||||
IntPtr lockedPtr = IntPtr.Zero;
|
||||
try
|
||||
|
@@ -2,6 +2,7 @@
|
||||
using NTwain.Triplets;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace NTwain
|
||||
@@ -87,11 +88,13 @@ namespace NTwain
|
||||
|
||||
bool _closeDsRequested;
|
||||
|
||||
private void HandleSourceMsg(MSG msg)
|
||||
private void HandleSourceMsg(MSG msg, [CallerMemberName] string? caller = null)
|
||||
{
|
||||
Debug.WriteLine($"[thread {Environment.CurrentManagedThreadId}] {nameof(HandleSourceMsg)} called by {caller} at state {State} with {msg}.");
|
||||
|
||||
// the reason we post these to the background is
|
||||
// if they're coming from UI message loop then
|
||||
// this needs to return asap
|
||||
// this needs to return asap (?)
|
||||
switch (msg)
|
||||
{
|
||||
case MSG.XFERREADY:
|
||||
|
@@ -175,7 +175,7 @@ namespace NTwain
|
||||
public STS GetCapValues<TValue>(CAP cap, out IList<TValue> values) where TValue : struct
|
||||
{
|
||||
values = new List<TValue>();
|
||||
var sts = GetCapCurrent(cap, out TW_CAPABILITY twcap);
|
||||
var sts = GetCapValues(cap, out TW_CAPABILITY twcap);
|
||||
if (sts.RC == TWRC.SUCCESS)
|
||||
{
|
||||
switch (twcap.ConType)
|
||||
|
@@ -5,7 +5,6 @@ using NTwain.Triplets;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Interop;
|
||||
using MSG = NTwain.Data.MSG;
|
||||
@@ -92,7 +91,7 @@ namespace NTwain
|
||||
handled = rc == TWRC.DSEVENT;
|
||||
if (_procEvent.TWMessage != 0 && (handled || rc == TWRC.NOTDSEVENT))
|
||||
{
|
||||
Debug.WriteLine($"[thread {Environment.CurrentManagedThreadId}]: CheckIfTwainMessage at state {State} with MSG={_procEvent.TWMessage}.");
|
||||
//Debug.WriteLine($"[thread {Environment.CurrentManagedThreadId}] CheckIfTwainMessage at state {State} with MSG={_procEvent.TWMessage}.");
|
||||
HandleSourceMsg((MSG)_procEvent.TWMessage);
|
||||
}
|
||||
}
|
||||
|
@@ -122,7 +122,7 @@ namespace NTwain
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
case MSG.CLOSEDS:
|
||||
case MSG.CLOSEDSOK:
|
||||
case MSG.CLOSEDSREQ:
|
||||
// this should be done on ui thread (or same one that enabled the ds)
|
||||
_uiThreadMarshaller.BeginInvoke(() =>
|
||||
|
Reference in New Issue
Block a user