This problem happens only on some scanners.
The call to "Twain32Native.DsmIdentity" must be done even if the call to "Twain32Native.DsUserInterface" fails.
If the datasource is not completely closed after an error, we are not able to re-open it without re-initialising the Twain class.
Steps to reproduce :
Start a scan process without paper in the tray (Exception is thrown to notify there is not paper)
Restart a scan process without paper in the tray (Exception is thrown, Error opening datasource)
Issue : https://github.com/tmyroadctfig/twaindotnet/issues/10 Removed the "if" condition and put everything in a "try/catch".
This problem happens only on some scanners. The call to "Twain32Native.DsmIdentity" must be done even if the call to "Twain32Native.DsUserInterface" fails. If the datasource is not completely closed after an error, we are not able to re-open it without re-initialising the Twain class.
Steps to reproduce :