コード例 #1
0
 private void OnConnect(object sender, EventArgs e)
 {
     Invoke(new Action(() =>
     {
         MessageBoxWrapper.Info("Fingerprint scanner connected");
     }));
 }
コード例 #2
0
 private void OnDisconnect(object sender, EventArgs e)
 {
     Invoke(new Action(() =>
     {
         MessageBoxWrapper.Info("Fingerprint scanner disconnected");
         DialogResult = DialogResult.No;
         Close();
     }));
 }
コード例 #3
0
        private void OnCapture(object sender, System.Drawing.Bitmap e)
        {
            if (!_listen)
            {
                return;
            }
            _listen = false;
            Invoke(new Action(async() =>
            {
                FingerprintBox.Image = e;

                await Task.Delay(500);

                foreach (var item in _checksum)
                {
                    if (!_verifier.Verify(item))
                    {
                        continue;
                    }

                    VerifiedChecksum = item;
                    DialogResult     = DialogResult.OK;
                    Close();
                    return;
                }

                var tryAgain = MessageBoxWrapper.Confirmation("Verification failed! Do you want to try again?") == DialogResult.Yes;
                if (!tryAgain)
                {
                    DialogResult = DialogResult.No;
                    Close();
                }

                FingerprintBox.Image = null;
                _listen = true;
            }));
        }