#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">
<Link>DeviceEventArgs.cs</Link>
</Compile>
<Compile Include="..\NTwain\ICapabilities.cs">
<Link>ICapabilities.cs</Link>
</Compile>
<Compile Include="..\NTwain\ICapWrapper.cs">
<Link>ICapWrapper.cs</Link>
</Compile>

View File

@ -27,11 +27,15 @@ namespace NTwain
/// <param name="source">The source.</param>
/// <param name="capability">The capability.</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
/// or
/// getConversionRoutine
/// </exception>
/// <exception cref="System.ArgumentNullException">source
/// or
/// getConversionRoutine</exception>
public CapWrapper(IDataSource source, CapabilityId capability,
Func<object, TValue> getConversionRoutine, bool readOnly)
{

View File

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

View File

@ -265,7 +265,7 @@ namespace NTwain
/// <value>
/// The capabilities.
/// </value>
public Capabilities Capabilities
public ICapabilities Capabilities
{
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>
/// The capabilities.
/// </value>
Capabilities Capabilities { get; }
ICapabilities Capabilities { get; }
/// <summary>
/// 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="DeviceEventArgs.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="ICapabilities.cs" />
<Compile Include="IDataSource.cs" />
<Compile Include="ILog.cs" />
<Compile Include="Internals\TraceLog.cs" />

View File

@ -23,7 +23,7 @@ namespace NTwain
/// <summary>
/// The build release version number.
/// </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>
public static class WpfImageTools
{
// <summary>
/// <summary>
/// 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.
/// </summary>