#90 Interface for Capabilities

This commit is contained in:
Eugene Wang
2017-08-08 20:23:26 -04:00
parent 2457d16a43
commit 717d5e2418
9 changed files with 1220 additions and 6 deletions

View File

@@ -79,6 +79,9 @@
<Compile Include="..\NTwain\DeviceEventArgs.cs"> <Compile Include="..\NTwain\DeviceEventArgs.cs">
<Link>DeviceEventArgs.cs</Link> <Link>DeviceEventArgs.cs</Link>
</Compile> </Compile>
<Compile Include="..\NTwain\ICapabilities.cs">
<Link>ICapabilities.cs</Link>
</Compile>
<Compile Include="..\NTwain\ICapWrapper.cs"> <Compile Include="..\NTwain\ICapWrapper.cs">
<Link>ICapWrapper.cs</Link> <Link>ICapWrapper.cs</Link>
</Compile> </Compile>

View File

@@ -27,11 +27,15 @@ namespace NTwain
/// <param name="source">The source.</param> /// <param name="source">The source.</param>
/// <param name="capability">The capability.</param> /// <param name="capability">The capability.</param>
/// <param name="getConversionRoutine">The value conversion routine in Get methods.</param> /// <param name="getConversionRoutine">The value conversion routine in Get methods.</param>
/// <exception cref="System.ArgumentNullException"> /// <param name="readOnly">if set to <c>true</c> then make this cap read-only.</param>
/// <exception cref="ArgumentNullException">
/// source /// source
/// or /// or
/// getConversionRoutine /// getConversionRoutine
/// </exception> /// </exception>
/// <exception cref="System.ArgumentNullException">source
/// or
/// getConversionRoutine</exception>
public CapWrapper(IDataSource source, CapabilityId capability, public CapWrapper(IDataSource source, CapabilityId capability,
Func<object, TValue> getConversionRoutine, bool readOnly) Func<object, TValue> getConversionRoutine, bool readOnly)
{ {

View File

@@ -9,7 +9,7 @@ namespace NTwain
/// <summary> /// <summary>
/// Exposes capabilities of a data source as properties. /// Exposes capabilities of a data source as properties.
/// </summary> /// </summary>
public class Capabilities public class Capabilities : ICapabilities
{ {
IDataSource _source; IDataSource _source;

View File

@@ -265,7 +265,7 @@ namespace NTwain
/// <value> /// <value>
/// The capabilities. /// The capabilities.
/// </value> /// </value>
public Capabilities Capabilities public ICapabilities Capabilities
{ {
get { return _caps ?? (_caps = new Capabilities(this)); } get { return _caps ?? (_caps = new Capabilities(this)); }
} }

1206
src/NTwain/ICapabilities.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -78,7 +78,7 @@ namespace NTwain
/// <value> /// <value>
/// The capabilities. /// The capabilities.
/// </value> /// </value>
Capabilities Capabilities { get; } ICapabilities Capabilities { get; }
/// <summary> /// <summary>
/// Gets or sets the current settings (CustomDSData) of this source if supported. /// Gets or sets the current settings (CustomDSData) of this source if supported.

View File

@@ -62,6 +62,7 @@
<Compile Include="Data\TwainTypesExtended.cs" /> <Compile Include="Data\TwainTypesExtended.cs" />
<Compile Include="DeviceEventArgs.cs" /> <Compile Include="DeviceEventArgs.cs" />
<Compile Include="GlobalSuppressions.cs" /> <Compile Include="GlobalSuppressions.cs" />
<Compile Include="ICapabilities.cs" />
<Compile Include="IDataSource.cs" /> <Compile Include="IDataSource.cs" />
<Compile Include="ILog.cs" /> <Compile Include="ILog.cs" />
<Compile Include="Internals\TraceLog.cs" /> <Compile Include="Internals\TraceLog.cs" />

View File

@@ -23,7 +23,7 @@ namespace NTwain
/// <summary> /// <summary>
/// The build release version number. /// The build release version number.
/// </summary> /// </summary>
public const string Build = "3.4.2"; // change this for each nuget release public const string Build = "3.5.0"; // change this for each nuget release
} }

View File

@@ -10,7 +10,7 @@ namespace NTwain
/// </summary> /// </summary>
public static class WpfImageTools public static class WpfImageTools
{ {
// <summary> /// <summary>
/// Loads a <see cref="Stream" /> into WPF <see cref="BitmapSource" />. The image created /// Loads a <see cref="Stream" /> into WPF <see cref="BitmapSource" />. The image created
/// will be a copy so the stream can be disposed once this call returns. /// will be a copy so the stream can be disposed once this call returns.
/// </summary> /// </summary>