Fixed creating/opening/closing twainsession multiple times in an app not working.

This commit is contained in:
soukoku
2014-08-14 07:34:55 -04:00
parent a8891efe3b
commit f073bc6b65
13 changed files with 147 additions and 53 deletions

View File

@@ -9,7 +9,7 @@ using System.Windows.Threading;
namespace NTwain.Internals
{
sealed class InternalMessageLoopHook : MessageLoopHook
sealed class InternalMessageLoopHook : MessageLoopHook
{
Dispatcher _dispatcher;
WindowsHook _hook;
@@ -55,14 +55,14 @@ namespace NTwain.Internals
}
}
internal override void BeginInvoke(Action action)
public override void BeginInvoke(Action action)
{
if (_dispatcher == null) { throw new InvalidOperationException(Resources.MsgLoopUnavailble); }
_dispatcher.BeginInvoke(DispatcherPriority.Normal, action);
}
internal override void Invoke(Action action)
public override void Invoke(Action action)
{
if (_dispatcher == null) { throw new InvalidOperationException(Resources.MsgLoopUnavailble); }