mirror of
https://github.com/soukoku/ntwain.git
synced 2025-09-18 17:47:57 +08:00
Started adding more wrapped caps.
This commit is contained in:
@@ -6,6 +6,9 @@ using System.Text;
|
||||
|
||||
namespace NTwain
|
||||
{
|
||||
//TODO: handle multi-value sets
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Wrapped class for reading/writing a TWAIN capability associated with a <see cref="DataSource"/>.
|
||||
/// </summary>
|
||||
@@ -25,6 +28,30 @@ namespace NTwain
|
||||
Func<TValue, ReturnCode> _setCustomRoutine;
|
||||
Func<TValue, TWCapability> _setProvider; // an simplified way to set() that only needs on cap value
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CapWrapper{TValue}" /> class.
|
||||
/// </summary>
|
||||
/// <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">
|
||||
/// source
|
||||
/// or
|
||||
/// valueConversionRoutine
|
||||
/// </exception>
|
||||
public CapWrapper(ICapControl source, CapabilityId capability,
|
||||
Func<object, TValue> getConversionRoutine)
|
||||
{
|
||||
if (source == null) { throw new ArgumentNullException("source"); }
|
||||
if (getConversionRoutine == null) { throw new ArgumentNullException("valueConversionRoutine"); }
|
||||
|
||||
_source = source;
|
||||
_convertRoutine = getConversionRoutine;
|
||||
Capability = capability;
|
||||
SupportedActions = source.CapQuerySupport(capability);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CapWrapper{TValue}" /> class.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user