Example #1
0
 void ProcessText(Object sender, String text)
 {
     try
     {
         if (currentTestDevice.Content == sender)
         {
             this.Dispatcher.Invoke(new Action(() => checkFinger.SetText(text)));
         }
     }
     catch (Exception ex)
     {
     }
 }
Example #2
0
        void TestPageDeviceSelected(object sender, RoutedEventArgs e)
        {
            RadioButton radioButton = (sender as RadioButton);

            try
            {
                // If Provider has an active device
                if (radioButton.Content is IFingerDevice)
                {
                    currentTestDevice           = (sender as RadioButton);
                    currentTestDevice.IsEnabled = false;
                    IFingerDevice device = (sender as RadioButton).Content as IFingerDevice;

                    TestScannerPage.Children.Clear();
                    checkFinger = new FingerDisplay();
                    TestScannerPage.Children.Add(checkFinger);

                    //checkFinger.SetText("Please, touch the scanner");
                    Ambassador.SetCallback(DispatchMessage);
                    device.Dispatch(COMMAND.LIVECAPTURE_START);
                    imageReseter.Start();
                }
                else
                {
                    Ambassador.ClearCallback();
                    if (checkFinger != null)
                    {
                        TestScannerPage.Children.Clear();
                        checkFinger = null;
                    }
                    checkFinger = new FingerDisplay(Properties.Resources.no_device);
                    TestScannerPage.Children.Add(checkFinger);
                    checkFinger.SetText("Connect device and press refresh");
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }