/// <summary>
        /// متد سازنده
        /// </summary>
        public MainViewModel()
        {
            if (!IsInDesignMode)
            {
                try
                {
                    //Proxies are created
                    QrService = new QRServiceProxy();
                    AutomatedAttendanceSystem = new AAS.Proxy.AutomatedAttendanceSystemProxy();
                    FaceRecognition           = new FaceRecognitionServiceProxy();

                    intitalizeAttendanceMethods();
                    EmguCVHelper.StartCapture();
                    EmguCVHelper.CaptureImageIsRefreshed += RefreshImage;
                    m_restTimer = new Timer(3000);

                    m_restTimer.Elapsed += restTimer_Elapsed;
                }
                catch (Exception ex)
                {
                    Exception exep = ex;
                    {
                        MessageBox.Show(exep.Message);
                    } while ((exep = exep.InnerException) != null)
                    {
                        ;
                    }
                }
                m_logs = new List <Log>();
            }
            else
            {
                Employee employee = new Employee()
                {
                    FirstName         = "احمد",
                    LastName          = "رحیمی",
                    Gender            = Gender.Male,
                    DateOfBirth       = new DateTime(1980, 01, 01),
                    DateOfEmployement = new DateTime(2000, 04, 12),
                    IdentityNumber    = "13654",
                    NationalID        = new IRNationalID("000-000004-3"),
                    EmployeeID        = new EmployeeID(0, 4, 1),
                    ProfilePicture    = new Bitmap(@"G:\_DATA\dummy.png"),
                };
                DetectedEmployee = employee;
                //DetectedEmployee = null;
                ErrorMessage             = (string)Application.Current.FindResource("FRSCouldNotDetect");
                AlternativeMethodMessage = (string)Application.Current.FindResource("FRSCouldNotDetectAlternativeMethod");
                EntryOrExit     = string.Format((string)Application.Current.FindResource("Entry"));
                EntryOrExitHour = DateTime.Now;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// متد سازنده
 /// </summary>
 public MainViewModel()
 {
     if (!IsInDesignMode)
     {
         try
         {
             FaceRecognitionService = new FaceRecognitionServiceProxy();
             if (FaceRecognitionService != null)
             {
                 EmguCVHelper.StartCapture();
                 EmguCVHelper.CaptureImageIsRefreshed += RefreshImage;
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
     m_savedFrames = new List <Bitmap>();
     processCommandLineArgs();
 }