Moved TWAIN type reading/writing under one class.

This commit is contained in:
soukoku
2015-01-11 13:16:02 -05:00
parent 8d30e9066f
commit 5fad8b3c02
10 changed files with 313 additions and 323 deletions

View File

@@ -68,14 +68,7 @@ namespace NTwain.Internals
// some DS end up getting none but we will assume it's image
if (xferImage)
{
// default to native
var mech = XferMech.Native;
object mechRaw = session.CurrentSource.CapGetCurrent(CapabilityId.ICapXferMech);
if (mechRaw != null)
{
mech = mechRaw.ConvertToEnum<XferMech>();
}
var mech = session.CurrentSource.ICapXferMech.GetCurrent();
switch (mech)
{
@@ -97,7 +90,7 @@ namespace NTwain.Internals
}
if (xferAudio)
{
var mech = session.CurrentSource.CapGetCurrent(CapabilityId.ACapXferMech).ConvertToEnum<XferMech>();
var mech = session.CurrentSource.ACapXferMech.GetCurrent();
switch (mech)
{
case XferMech.File: