protected override void OnEndImport(ImporterConverterAbstract.EndImport EI) { switch (EI.State) { case ImportState.OK: bool RarC = GetTransactionContext() == ImportType.UnRar; InFiles.Apply(mc => Context.ConvertManager.OnSourceConverted(mc, RarC)); //foreach (string MC in InFiles) // Context.ConvertManager.OnSourceConverted(MC, RarC); break; case ImportState.NotFinalized: case ImportState.KO: //je ne suis pas arrive a tenter les imports ou tous les import sont ko //on clean tout Context.Folders.GetFileCleanerFromFiles(OutFilesFiles, n => false, false).Remove(); break; case ImportState.Partial: if (EI.FilesNotimported.Any()) { //add to file not imported file which convertion result in a not imported file var notimportedfiles = InFiles.Where(t => ConvertedFiles(t).Any() && ConvertedFiles(t).All(f => EI.FilesNotimported.Contains(f))); notimportedfiles.Apply( to => EI.AddTrackKODuringImport(to)); //foreach(string to in from t in InFiles where ( ConvertedFiles(t).Any() && ConvertedFiles(t).All(f=>EI.FilesNotimported.Contains(f))) select t) //{ // EI.AddTrackKODuringImport(to); //} Context.Folders.GetFileCleanerFromFiles(EI.FilesNotimported, n => false, false).Remove(); } break; } }
protected override void OnEndImport(ImporterConverterAbstract.EndImport EI) { }
protected override void OnEndImport(ImporterConverterAbstract.EndImport EI) { switch(EI.State) { case ImportState.OK: return; case ImportState.Partial: if (EI.FilesNotimported.Any()) { Context.Folders.GetFileCleanerFromFiles( OutFilesFiles.Where( t => EI.FilesNotimported.Contains(t)), n => false, false).Remove(); } return; case ImportState.KO: case ImportState.NotFinalized: Context.Folders.GetFileCleanerFromFiles(OutFilesFiles, n => false, false).Remove(); break; } }
protected override void OnEndImport(ImporterConverterAbstract.EndImport EI) { Context.RarManager.OnUnrar(_FN, ((EI.State == ImportState.OK) || (EI.State == ImportState.Partial))); GC.Collect(); GC.WaitForPendingFinalizers(); switch(EI.State) { case ImportState.OK: break; case ImportState.NotFinalized: case ImportState.KO: //je ne suis pas arrive a tenter les imports ou tous les import sont ko //on clean tout Context.Folders.GetFileCleanerFromFiles(OutFilesFiles, n => false, false).Remove(); break; case ImportState.Partial: //ImportState partiel if (EI.FilesNotimported.Any()) { Context.Folders.GetFileCleanerFromFiles(OutFilesFiles.Where(t=> EI.FilesNotimported.Contains(t)), n => false, false).Remove(); } break; } }