Merge pull request #4 from soukoku/v4-dev

Readme & exception throws
This commit is contained in:
Eugene Wang 2018-11-24 13:53:39 -05:00 committed by GitHub
commit c6ec249e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View File

@ -1,18 +1,18 @@
# TWAIN dotnet library
NOTE: THIS IS V4 DEV AND DOESN'T WORK YET.
USE V3 BRANCH FOR WORKING VERSION.
NOTE: This is V4 DEV and doesn't fully work yet.
Use V3 branch for working version.
## Info
This is a library created to make working with
[TWAIN](http://twain.org/) easier in dotnet.
This is a dotnet library created to make working with
[TWAIN](http://twain.org/) easier.
V4 of this lib has these goals:
* Targets latest TWAIN version (2.4 as of this writing)
* Supports all the TWAIN functions in the spec (directly or through dotnet wrapper)
* Works with both 32 or 64 bit data sources, from 32 or 64 bit apps.
* Works on non-Windows platforms using dotnet core
* Targets latest TWAIN version (2.4 as of this writing).
* Supports all the TWAIN functions in the spec (directly or through dotnet wrapper).
* Works with both 32 or 64 bit data sources, under 32 or 64 bit apps.
* Supports dotnet 4+ and netcore 2+ apps.
## Using the lib

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Threading.Tasks;
@ -18,9 +19,13 @@ namespace NTwain.Internals
{
if (ex != null)
{
#if NET40
typeof(Exception).GetMethod("PrepForRemoting",
BindingFlags.NonPublic | BindingFlags.Instance)?.Invoke(ex, new object[0]);
throw ex;
#else
ExceptionDispatchInfo.Capture(ex).Throw();
#endif
}
}