mirror of
https://github.com/soukoku/ntwain.git
synced 2026-02-25 13:04:07 +08:00
Added cap enum map idea.
This commit is contained in:
@@ -161,10 +161,11 @@ namespace WinFormSample
|
||||
|
||||
if (twain.GetCapCurrent(c, out TW_CAPABILITY twcap).RC == TWRC.SUCCESS)
|
||||
{
|
||||
var type = twcap.DetermineValueType(twain);
|
||||
it.SubItems.Add(type.ToString());
|
||||
it.SubItems.Add(ReadTypedValue(c, type, forCurrent: true));
|
||||
it.SubItems.Add(ReadTypedValue(c, type, forCurrent: false));
|
||||
var enumType = KnownCapEnumMap.GetEnumType(c);
|
||||
var realType = twcap.DetermineValueType(twain);
|
||||
it.SubItems.Add(enumType?.Name.ToString() ?? realType.ToString());
|
||||
it.SubItems.Add(ReadTypedValue(c, realType, forCurrent: true));
|
||||
it.SubItems.Add(ReadTypedValue(c, realType, forCurrent: false));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using NTwain.Data;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace WinFormSample
|
||||
|
||||
Reference in New Issue
Block a user