Exemplo n.º 1
0
        /// <summary>
        /// 采集指纹状态切换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void OnStateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            CollectFingerWindow fingerWindow = sender as CollectFingerWindow;
            FingerStatus        fingerStatus = (FingerStatus)e.NewValue;

            fingerWindow.txtMsg.Visibility     = Visibility.Collapsed;
            fingerWindow.recordGrid.Visibility = Visibility.Collapsed;
            fingerWindow.btnStart.Content      = fingerWindow.TryFindResource("appSure").ToString();
            switch (fingerStatus)
            {
            case FingerStatus.Recording:
                fingerWindow.recordGrid.Visibility = Visibility.Visible;
                fingerWindow.fingerImg.Source      = new BitmapImage(new Uri(@"/Hytera.EEMS.Resources;Component/Images/Finger/recordImg.png", UriKind.RelativeOrAbsolute));
                break;

            case FingerStatus.RecordFail:
                fingerWindow.fingerImg.Source  = new BitmapImage(new Uri(@"/Hytera.EEMS.Resources;Component/Images/Finger/recordFail.png", UriKind.RelativeOrAbsolute));
                fingerWindow.txtMsg.Visibility = Visibility.Visible;
                fingerWindow.btnStart.Content  = fingerWindow.TryFindResource("FingerReRecord").ToString();;
                break;

            case FingerStatus.RecordSuccess:
                fingerWindow.fingerImg.Source = new BitmapImage(new Uri(@"/Hytera.EEMS.Resources;Component/Images/Finger/recordSuccess.png", UriKind.RelativeOrAbsolute));
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 指纹采集结果
        /// </summary>
        /// <param name="value"></param>
        private void AnalyzeCollectFingerPrint(string value)
        {
            App.Current.Dispatcher.Invoke(new Action(() =>
            {
                FingerResult fingerResult = XmlUnityConvert.XmlDeserialize <FingerResult>(value);

                CollectFingerWindow collectFingerWindow = WindowsHelper.GetWindow <CollectFingerWindow>();
                if (collectFingerWindow == null || !(collectFingerWindow.CurrentUser.UserID.Equals(fingerResult.UserID)))
                {
                    return;
                }

                collectFingerWindow.FingerImage  = fingerResult.FingerImage;
                collectFingerWindow.FingerStatus = fingerResult.ResultCode == 0 ? FingerStatus.RecordSuccess : FingerStatus.RecordFail;
            }));
        }