diff --git a/src/NTwain/CapWrapper.cs b/src/NTwain/CapWrapper.cs index eebd6db..d8a9d44 100644 --- a/src/NTwain/CapWrapper.cs +++ b/src/NTwain/CapWrapper.cs @@ -308,15 +308,7 @@ namespace NTwain /// public CapabilityReader GetValuesRaw() { - using (TWCapability cap = new TWCapability(Capability)) - { - var rc = _source.DGControl.Capability.Get(cap); - if (rc == ReturnCode.Success) - { - return CapabilityReader.ReadValue(cap); - } - } - return null; + return _source.Capabilities.GetValuesRaw(Capability); } /// diff --git a/src/NTwain/Capabilities.cs b/src/NTwain/Capabilities.cs index b117543..9b08139 100644 --- a/src/NTwain/Capabilities.cs +++ b/src/NTwain/Capabilities.cs @@ -147,6 +147,26 @@ namespace NTwain return Enumerable.Empty(); } + /// + /// Gets all the possible values of this capability without expanding. + /// This may be required to work with large range values that cannot be safely enumerated + /// with . + /// + /// The capability id. + /// + public CapabilityReader GetValuesRaw(CapabilityId capabilityId) + { + using (TWCapability cap = new TWCapability(capabilityId)) + { + var rc = _source.DGControl.Capability.Get(cap); + if (rc == ReturnCode.Success) + { + return CapabilityReader.ReadValue(cap); + } + } + return new CapabilityReader(); + } + /// /// Resets all values and constraint to power-on defaults. /// diff --git a/src/NTwain/CapabilityReader.cs b/src/NTwain/CapabilityReader.cs index 988aae2..9633427 100644 --- a/src/NTwain/CapabilityReader.cs +++ b/src/NTwain/CapabilityReader.cs @@ -123,7 +123,7 @@ namespace NTwain public ItemType ItemType { get; private set; } /// - /// Gets the one value if container is . + /// Gets the one value if container is . /// /// /// The one value. @@ -280,7 +280,7 @@ namespace NTwain } } break; - // these should never happen since TW_ENUM fields are 4 bytes but you never know + // these should never happen since TW_RANGE fields are 4 bytes but you never know case Data.ItemType.UInt16: { var min = (ushort)RangeMinValue; @@ -439,7 +439,7 @@ namespace NTwain RangeCount = ((max - min) / step) + 1; } break; - // these should never happen since TW_ENUM fields are 4 bytes but you never know + // these should never happen since TW_RANGE fields are 4 bytes but you never know case Data.ItemType.UInt16: { var min = (ushort)RangeMinValue; diff --git a/src/NTwain/Properties/VersionInfo.cs b/src/NTwain/Properties/VersionInfo.cs index 3e1a861..19d11c9 100644 --- a/src/NTwain/Properties/VersionInfo.cs +++ b/src/NTwain/Properties/VersionInfo.cs @@ -23,7 +23,7 @@ namespace NTwain /// /// The build release version number. /// - public const string Build = "3.3.6"; // change this for each nuget release + public const string Build = "3.3.7"; // change this for each nuget release }