twain32_events_FileXferEvent.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7. using System.Configuration;
  8. using System.Threading;
  9. using Saraff.Twain;
  10. using HXX.Scanner.Common;
  11. namespace HXX.Scanner.Biz
  12. {
  13. public partial class twain32_events
  14. {
  15. /// <summary>
  16. /// 文件已经生成事件,通知进行接下来的处理,e.ImageFileXfer.FileName为本次生成的文件名
  17. /// </summary>
  18. /// <param name="sender"></param>
  19. /// <param name="e"></param>
  20. public static void _twain32_FileXferEvent(object sender, Saraff.Twain.Twain32.FileXferEventArgs e)
  21. {
  22. //测试扫描一张 || 取消扫描
  23. //if (config_environment.scan_type != ScanType.Formal && !config_environment.scan_ab)
  24. //{
  25. // //测试只扫描一张(一面)
  26. // try
  27. // {
  28. // e.Cancel = true;
  29. // }
  30. // catch (Exception ex)
  31. // {
  32. // LogManager.WriteLog(ex);
  33. // }
  34. //}
  35. if (config_environment.scan_state)
  36. {
  37. biz_scanHistory.add_history();
  38. file_manager.save(e.ImageFileXfer.FileName);
  39. }
  40. }
  41. }
  42. }