예제 #1
0
        private void TnitialStar(object sender, RoutedEventArgs e)
        {
            if (_faceThread == null)
            {
                Console.WriteLine("第一次");
                System.Timers.Timer initialTimer = new System.Timers.Timer();
                initialTimer.Elapsed  += initialTimer_Elapsed;
                initialTimer.Interval  = 1000;
                initialTimer.Enabled   = true;
                initialTimer.AutoReset = false;
            }
            else
            {
                Console.WriteLine("第二次");

                FaceVerification faceVerification = new FaceVerification();
                faceVerification.Show();
                Prompt.Visibility        = System.Windows.Visibility.Collapsed;
                faceVerification.Closed += delegate
                {
                    if (MainWindow1.flag == 2)
                    {
                        ToPrint();
                    }
                };
            }
        }
예제 #2
0
        /// <summary>
        /// 初始化人脸
        /// </summary>
        public void InitFace()
        {
            try
            {
                //初始化人脸引擎
                Console.WriteLine("初始化人脸引擎");
                //_faceThread = new FaceThread();
                isFaceLode = true;
                //MessageBox.Show(isFaceLode.ToString());
                App.Current.Dispatcher.Invoke((Action)(() =>
                {
                    FaceVerification faceVerification = new FaceVerification();
                    Prompt.Visibility = System.Windows.Visibility.Collapsed;
                    faceVerification.Show();

                    faceVerification.Closed += delegate
                    {
                        if (MainWindow1.flag == 2)
                        {
                            ToPrint();
                        }
                        else
                        {
                            BaoDao(vm.IDCardData.GetIDCardInfo().Idcard);


                            //GetToken();
                            //GetDepart();
                            //Xinxi();
                            //Test();
                        }
                    };
                }));
            }
            catch (Exception ex)
            {
                isFaceLode = false;

                MessageBox.Show(ex.Message);
            }
        }