Exemplo n.º 1
0
        public void ToogleCameraService()
        {
            if (!IsStarted())
            {
                Task.Delay(700).ContinueWith(_ =>
                {
                    StartCapturing(_parameters.DeviceIndex);

                    _controls.IsDeviceChangeEnabled = false;
                    _controls.ServiceButtonText     = ButtonText.NoRetrieve.GetDesciption();
                    _controls.Name    = string.Empty;
                    _controls.Age     = string.Empty;
                    _controls.Address = string.Empty;
                    _controls.Details = string.Empty;

                    _controls.StatusText  = StatusTypes.StreamStarted.GetDesciption();
                    _controls.IsNewUpdate = true;

                    _controls.IsSaveEnabled = false;

                    StatusBarUtility.ResestStatus(_controls);
                });
            }
            else
            {
                StopCapturing();

                _controls.IsDeviceChangeEnabled = true;
                _controls.ServiceButtonText     = ButtonText.Retrieve.GetDesciption();
                _controls.KnownPeople           = _parameters.UseExplorer
                    ? _localStorageService.GetPeopleNames()
                    : _databaseService.GetPeopleNames();

                _controls.StatusText  = StatusTypes.StreamPaused.GetDesciption();
                _controls.IsNewUpdate = true;

                if (_controls.TheNewestFace != null)
                {
                    _controls.IsSaveEnabled = true;
                }

                StatusBarUtility.ResestStatus(_controls);
            }
        }