protected virtual void RaiseCameraEvent(CameraEventBase eventBase)
 {
     EventHandler<CameraEventBase> handler = CameraErrorEvent;
     if (handler != null) handler(this, eventBase);
 }
 private void ImageProcessorOnCameraErrorEvent(object sender, CameraEventBase cameraError)
 {
     var handler = CameraErrorEvent;
     if (handler != null)
         handler(this, cameraError);
 }
        private void ImageProcessorOnCameraErrorEvent(object sender, CameraEventBase cameraErrorInfo)
        {
            switch (cameraErrorInfo.EventType)
            {
                case CameraEventType.Shutdown:
                    TakingPicture = false;
                    //_dialogService.ShowInfo(cameraErrorInfo.Message);
                    Dispose();
                    break;
                case CameraEventType.Error:
                    TakingPicture = false;

                    ErrorEvent ev = cameraErrorInfo as ErrorEvent;
                    if (ev != null && ev.ErrorCode == ReturnValue.TakePictureAutoFocusNG)
                    {
                       // _dialogService.ShowInfo("Не удалось сфокусироваться. Пожалуйста, повторите попытку.");
                        Dispose();
                        Initialize();
                    }
                    break;
            }
        }