mirror of
https://github.com/soukoku/ntwain.git
synced 2025-10-25 19:19:03 +08:00
More sanity checks.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user