Exemple #1
0
 void HandleCopy(ICollection <KeyValuePair <string, List <string> > > copy, IDictionary <string, Status> statusDic)
 {
     StatusRepo.ResetWithoutClearItems(RepoStatus.Copying, copy.Count);
     copy.ForEach(x => {
         x.Value.ForEach(y => CopyExistingWorkingFile(statusDic, y, x.Key));
         StatusRepo.IncrementDone();
     });
 }
Exemple #2
0
        void HandleRemove(List <string> remove, IDictionary <string, Status> statusDic)
        {
            StatusRepo.ResetWithoutClearItems(RepoStatus.Removing, remove.Count());

            remove.ForEach(x => ProcessRemoved(statusDic, x));

            foreach (var d in GetEmptyDirectories(remove))
            {
                Tools.FileUtil.Ops.DeleteDirectory(d);
                StatusRepo.IncrementDone();
            }
        }
Exemple #3
0
        void HandleModify(ICollection <FileObjectMapping> modify, IDictionary <string, Status> statusDic,
                          ProgressLeaf progressLeaf)
        {
            StatusRepo.ResetWithoutClearItems(RepoStatus.Unpacking, modify.Count);
            var i = 0;

            modify.OrderByDescending(x => Tools.FileUtil.SizePrediction(x.FilePath))
            .ForEach(m => {
                ProcessModified(statusDic, m,
                                (p, s) => progressLeaf?.Update(null, (i + p / 100).ToProgress(modify.Count)));
                StatusRepo.IncrementDone();
                progressLeaf?.Update(null, i++.ToProgress(modify.Count));
            });
            progressLeaf?.Finish();
        }