Exemple #1
0
        private IEnumerable <IInfosOpérationDépôt> TéléchargerCabs(IEnumerable <IParution> parutionsCiblées,
                                                                   IDépôtCabPao dépôtCabPao,
                                                                   IDépôtCab dépôtCabExterne,
                                                                   IOptionsTéléchargementCabs optionsTéléchargement,
                                                                   IAfficheurTâches afficheurTâches)
        {
            var observer = _taskObserverFactory.CreateTaskObserver();

            afficheurTâches.AjouterTâche($"Téléchargement des Cabs depuis [{dépôtCabExterne}]",
                                         observer);
            try
            {
                observer.NotifyStarted(this);
                observer.NotifyProgress(this, 0);

                var résultat =
                    TéléchargerCabsCore(parutionsCiblées, dépôtCabPao, dépôtCabExterne,
                                        optionsTéléchargement.ConvertirCabVersTiff, observer);

                observer.NotifyProgress(this, 100);
                observer.NotifyCompleted(this);

                return(résultat);
            }
            catch (Exception exception)
            {
                observer.NotifyError(this, exception.DetailedMessage());
                observer.NotifyAborted(this, "Interruption causée par une erreur");
                throw;
            }
        }
Exemple #2
0
        private void ChargerPlanning(IAfficheurTâches afficheurTâches)
        {
            var observer = _taskObserverFactory.CreateTaskObserver();

            afficheurTâches.AjouterTâche("Chargement des données du planning", observer);
            try
            {
                observer.NotifyStarted(this);
                observer.NotifyProgress(this, 0);
                _dépôtParutions.ChargerParutions(observer);
                observer.NotifyProgress(this, 100);
                observer.NotifyCompleted(this);
            }
            catch (Exception exception)
            {
                observer.NotifyError(this, exception.DetailedMessage());
                observer.NotifyAborted(this, exception.DetailedMessage());
            }
        }
Exemple #3
0
        private IDépôtCab ChargerDépôtCab(IDépôtCab dépôtCab, IAfficheurTâches afficheurTâches)
        {
            var observer = _taskObserverFactory.CreateTaskObserver();

            afficheurTâches.AjouterTâche($"Examen des Cabs disponibles sur [{dépôtCab}]", observer);
            try
            {
                observer.NotifyStarted(this);
                observer.NotifyProgress(this, 0);

                dépôtCab.ChargerCabs(observer);

                observer.NotifyProgress(this, 100);
                observer.NotifyCompleted(this);

                return(dépôtCab);
            }
            catch (Exception exception)
            {
                observer.NotifyError(this, exception.DetailedMessage());
                observer.NotifyAborted(this, "Interruption causée par une erreur");
                throw;
            }
        }