Esempio n. 1
0
        private void ChargerDossiersPao(ITaskObserver observer)
        {
            observer.NotifyIsIndeterminate(this);

            var dossiers = Directory.GetDirectories(_racinePao, "*.*",
                                                    SearchOption.TopDirectoryOnly);

            observer.NotifyProgress(this, 0);

            var dossiersParutions =
                (from dossier in observer.InSlice(0, 10).EnumerableProgressTracker(this, dossiers)
                 let parution = Parution(dossier)
                                where parution != null
                                select new { Parution = parution, Dossier = dossier }).ToList();


            _dossiersParutions = dossiersParutions.ToLookup(dp => dp.Parution, dp => dp.Dossier);

            var cabs =
                from dossierParution in observer.InSlice(15, 100).EnumerableProgressTracker(this, dossiersParutions)
                let fi = ExtraireCabFileInfo(dossierParution.Dossier, dossierParution.Parution)
                         where fi != null
                         let cab = CréerCab(fi, dossierParution.Parution)
                                   where cab != null
                                   select cab;

            _listeDonnéesCab = new List <ICab>(cabs);

            observer.NotifyProgress(this, 100);
        }