Added cap value report saver to wpf sample.

This commit is contained in:
Eugene Wang
2017-02-03 07:06:44 -05:00
parent 676a4c640a
commit 24bd82670a
6 changed files with 77 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
using NTwain.Data;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
@@ -111,7 +112,9 @@ namespace NTwain
if (!_supports.HasValue && _source.IsOpen)
{
var srcVersion = _source.ProtocolVersion;
if (srcVersion >= ProtocolVersions.GetMinimumVersion(Capability))
var minVer = ProtocolVersions.GetMinimumVersion(Capability);
if (srcVersion >= minVer)
{
_supports = _source.Capabilities.QuerySupport(Capability);
@@ -137,6 +140,7 @@ namespace NTwain
}
else
{
Debug.WriteLine("Cap " + Capability + " supports set to None due to rc=" + rc + ", cc=" + _source.GetStatus().ConditionCode);
_supports = QuerySupports.None;
}
}
@@ -144,6 +148,7 @@ namespace NTwain
}
else
{
Debug.WriteLine("Cap " + Capability + " supports set to None due to not in required TWAIN version (" + minVer + ") not met by source (" + srcVersion + ").");
_supports = QuerySupports.None;
}
}

View File

@@ -177,12 +177,13 @@ namespace NTwain
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
ReturnCode SetValue(TValue value);/// <summary>
///
/// A version of Set that uses an array.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
ReturnCode SetValue(TValue value);
/// <summary>
/// A version of Set that uses an array.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
ReturnCode SetValue(TWArray value);
/// <summary>