More sanity checks.

This commit is contained in:
soukoku
2014-04-19 21:20:50 -04:00
parent 15779dbb15
commit d6e2f0e811
2 changed files with 11 additions and 4 deletions

View File

@@ -1700,14 +1700,14 @@ namespace NTwain.Data
{
return new TWIdentity
{
Manufacturer = manufacturer ?? "UNKNOWN",
Manufacturer = string.IsNullOrEmpty(manufacturer) ? "UNKNOWN" : manufacturer,
ProtocolMajor = TwainConst.ProtocolMajor,
ProtocolMinor = TwainConst.ProtocolMinor,
DataGroup = DataGroups.Control | supportedGroups,
DataFunctionalities = DataFunctionalities.App2,
ProductFamily = productFamily ?? "UNKNOWN",
ProductName = productName ?? "UNKNOWN",
ProductFamily = string.IsNullOrEmpty(productFamily) ? "UNKNOWN" : productFamily,
ProductName = string.IsNullOrEmpty(productName) ? "UNKNOWN" : productName,
Version = new TWVersion
{
Major = (short)version.Major,

View File

@@ -18,7 +18,10 @@ namespace Tester
static void Main(string[] args)
{
// just an amusing example to do twain in console without UI
DoTwainWork();
ThreadPool.QueueUserWorkItem(o =>
{
DoTwainWork();
});
Console.WriteLine("Test started, press Enter to exit.");
Console.ReadLine();
}
@@ -66,6 +69,10 @@ namespace Tester
}
}
}
else
{
Console.WriteLine("Failed to open dsm with rc={0}!", rc);
}
}
static void twain_SourceDisabled(object sender, EventArgs e)