示例#1
0
        protected override void OnAfterActivate()
        {
            _license = new Biolink.Biometrics2.License(Biolink.Biometrics2.LicenseType.ALL);

            //получаем список устройств
            using (var devices = new Biolink.Biometrics2.DeviceList(Biolink.Biometrics2.DeviceType.UmatchScanner))
            {
                if (devices.Size == 0)
                {
                    return;
                }

                // пока что выбираем первый попавшийся сканер
                for (int i = 0; i < devices.Size; i++)
                {
                    using (var descriptor = devices.DeviceDescriptor(i))
                    {
                        if (descriptor.InstanceId == ScannerId)
                        {
                            _scanner = new Biolink.Biometrics2.Scanner(descriptor);
                        }
                    }
                }
            }

            if (_scanner == null)
            {
            }

            base.OnAfterActivate();
        }
示例#2
0
 protected override void OnAfterDeactivate()
 {
     if (_scanner != null)
     {
         _scanner.Dispose();
         _scanner = null;
     }
     base.OnAfterDeactivate();
 }
示例#3
0
 public override void Dispose()
 {
     if (_scanner != null)
     {
         _scanner.Dispose();
         _scanner = null;
     }
     if (_license != null)
     {
         _license.Close();
         _license = null;
     }
     base.Dispose();
 }