Updated shared lib and verbages.

This commit is contained in:
soukoku
2014-04-13 09:30:39 -04:00
parent dc41cebc18
commit 04ee0baf75
8 changed files with 38 additions and 19 deletions

View File

@@ -203,7 +203,7 @@ namespace NTwain
/// <summary> /// <summary>
/// Opens the data source manager. This must be the first method used /// Opens the data source manager. This must be the first method used
/// before using other TWAIN functions. Calls to this must be followed by <see cref="CloseManager"/> when done. /// before using other TWAIN functions. Calls to this must be followed by <see cref="CloseManager"/> when done with a TWAIN session.
/// </summary> /// </summary>
/// <param name="appHandle">On Windows = points to the window handle (hWnd) that will act as the Sources /// <param name="appHandle">On Windows = points to the window handle (hWnd) that will act as the Sources
/// "parent". On Macintosh = should be a NULL value.</param> /// "parent". On Macintosh = should be a NULL value.</param>
@@ -254,7 +254,7 @@ namespace NTwain
/// <summary> /// <summary>
/// Loads the specified source into main memory and causes its initialization. /// Loads the specified source into main memory and causes its initialization.
/// Calls to this must be followed by /// Calls to this must be followed by
/// <see cref="CloseSource" /> when done. /// <see cref="CloseSource" /> when not using it anymore.
/// </summary> /// </summary>
/// <param name="sourceProductName">Name of the source.</param> /// <param name="sourceProductName">Name of the source.</param>
/// <returns></returns> /// <returns></returns>
@@ -296,14 +296,15 @@ namespace NTwain
} }
/// <summary> /// <summary>
/// Enables the source. /// Enables the source to start transferring.
/// </summary> /// </summary>
/// <param name="mode">The mode.</param> /// <param name="mode">The mode.</param>
/// <param name="modal">if set to <c>true</c> any driver UI will display as modal.</param> /// <param name="modal">if set to <c>true</c> any driver UI will display as modal.</param>
/// <param name="windowHandle">The window handle if modal.</param> /// <param name="windowHandle">The window handle if modal.</param>
/// <param name="context">The /// <param name="context">
/// Windows only. /// The
/// <see cref="SynchronizationContext" /> that is required for certain operations. /// <see cref="SynchronizationContext" /> is required if TWAIN is using callback mode
/// instead of the typical WndProc message loop.
/// It is recommended you call this method in an UI thread and pass in /// It is recommended you call this method in an UI thread and pass in
/// <see cref="SynchronizationContext.Current" /> /// <see cref="SynchronizationContext.Current" />
/// if you do not have a custom one setup.</param> /// if you do not have a custom one setup.</param>
@@ -311,7 +312,7 @@ namespace NTwain
/// <exception cref="ArgumentNullException">context</exception> /// <exception cref="ArgumentNullException">context</exception>
public ReturnCode EnableSource(SourceEnableMode mode, bool modal, IntPtr windowHandle, SynchronizationContext context) public ReturnCode EnableSource(SourceEnableMode mode, bool modal, IntPtr windowHandle, SynchronizationContext context)
{ {
if (context == null) { throw new ArgumentNullException("context"); } if (context == null && _callbackObj != null) { throw new ArgumentNullException("SynchronizationContext is required when not using message loop.", "context"); }
Debug.WriteLine(string.Format("Thread {0}: EnableSource.", Thread.CurrentThread.ManagedThreadId)); Debug.WriteLine(string.Format("Thread {0}: EnableSource.", Thread.CurrentThread.ManagedThreadId));

View File

@@ -1962,7 +1962,7 @@ namespace NTwain.Values
/// Bit mask for querying the operation that are supported by the data source on a capability. /// Bit mask for querying the operation that are supported by the data source on a capability.
/// Corresponds to TWQC_*. /// Corresponds to TWQC_*.
/// </summary> /// </summary>
static class QuerySupportMask public static class QuerySupportMask
{ {
public const int Get = 0x1; public const int Get = 0x1;
public const int Set = 0x2; public const int Set = 0x2;
@@ -1976,4 +1976,18 @@ namespace NTwain.Values
public const int GetLabelEnum = 0x400; public const int GetLabelEnum = 0x400;
} }
/// <summary>
/// TWAIN's boolean values.
/// </summary>
public enum BoolType : ushort
{
/// <summary>
/// The false value (0).
/// </summary>
False = 0,
/// <summary>
/// The true value (1).
/// </summary>
True = 1
}
} }

View File

@@ -1,7 +1,7 @@
namespace NTwain.Values namespace NTwain.Values
{ {
/// <summary> /// <summary>
/// Contains magic number for some TWAIN stuff. /// Contains direct magic values for some TWAIN stuff.
/// </summary> /// </summary>
public static class TwainConst public static class TwainConst
{ {

View File

@@ -7,8 +7,8 @@ This is a dotnet library created to work with [TWAIN](http://twain.org/) interfa
This project follows these general goals: This project follows these general goals:
* Targets latest TWAIN version (2.3 at the moment) * Targets latest TWAIN version (2.3 at the moment)
* Supports all the TWAIN functions in the spec (mostly there) * Supports all the TWAIN functions in the spec
* Eventally work on platforms other than Windows (just a dream) * Eventally work on platforms other than Windows (I can dream)
The solution contains sample projects in winforms, wpf, and even (gasp!) console. The solution contains sample projects in winforms, wpf, and even (gasp!) console.
A nuget package is also [available here](https://www.nuget.org/packages/ntwain) A nuget package is also [available here](https://www.nuget.org/packages/ntwain)
@@ -17,5 +17,9 @@ Using the lib
-------------------------------------- --------------------------------------
To properly use this lib you will need to be reasonably familiar with the TWAIN spec To properly use this lib you will need to be reasonably familiar with the TWAIN spec
and how it works in general. Except for certain "important" calls that drive the and how it works in general. Except for certain "important" calls that drive the
TWAIN state change, most triplet operations are availble as-is so you will need to know TWAIN state change, most triplet operations are only availble as-is so you will need to know
when to use them. There are no high-level, single-line scan-a-page-for-me-now functions here. when and how to use them. There are no high-level, single-line scan-a-page-for-me-now functions.
At the moment this lib does not provide ways to parse transferred image data and require
consumers to do the conversion. The winform project contains one such
example for handling DIB image in native transfer.

View File

@@ -42,7 +42,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="CommonWin32, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a0a4edcfe233918d, processorArchitecture=MSIL"> <Reference Include="CommonWin32, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a0a4edcfe233918d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\CommonWin32.2.0.4\lib\net35-Client\CommonWin32.dll</HintPath> <HintPath>..\..\packages\CommonWin32.2.0.5\lib\net35-Client\CommonWin32.dll</HintPath>
</Reference> </Reference>
<Reference Include="GalaSoft.MvvmLight.Extras.WPF4"> <Reference Include="GalaSoft.MvvmLight.Extras.WPF4">
<HintPath>..\..\packages\MvvmLightLibs.4.3.31.1\lib\net40\GalaSoft.MvvmLight.Extras.WPF4.dll</HintPath> <HintPath>..\..\packages\MvvmLightLibs.4.3.31.1\lib\net40\GalaSoft.MvvmLight.Extras.WPF4.dll</HintPath>
@@ -55,7 +55,7 @@
</Reference> </Reference>
<Reference Include="ModernWPF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c99d0cfbea7491ef, processorArchitecture=MSIL"> <Reference Include="ModernWPF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c99d0cfbea7491ef, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\ModernWPF.1.1.41.2\lib\net40-Client\ModernWPF.dll</HintPath> <HintPath>..\..\packages\ModernWPF.1.1.41.3\lib\net40-Client\ModernWPF.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CommonServiceLocator" version="1.2" targetFramework="net40-Client" /> <package id="CommonServiceLocator" version="1.2" targetFramework="net40-Client" />
<package id="CommonWin32" version="2.0.4" targetFramework="net40-Client" /> <package id="CommonWin32" version="2.0.5" targetFramework="net40-Client" />
<package id="ModernWPF" version="1.1.41.2" targetFramework="net40-Client" /> <package id="ModernWPF" version="1.1.41.3" targetFramework="net40-Client" />
<package id="MvvmLightLibs" version="4.3.31.1" targetFramework="net40-Client" /> <package id="MvvmLightLibs" version="4.3.31.1" targetFramework="net40-Client" />
</packages> </packages>

View File

@@ -37,7 +37,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="CommonWin32, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a0a4edcfe233918d, processorArchitecture=MSIL"> <Reference Include="CommonWin32, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a0a4edcfe233918d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\CommonWin32.2.0.4\lib\net35-Client\CommonWin32.dll</HintPath> <HintPath>..\..\packages\CommonWin32.2.0.5\lib\net35-Client\CommonWin32.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CommonWin32" version="2.0.4" targetFramework="net35-Client" /> <package id="CommonWin32" version="2.0.5" targetFramework="net35-Client" />
</packages> </packages>