MoveCommand

This commit is contained in:
2023-07-04 22:07:11 +02:00
parent 718fd53026
commit 453834646b
17 changed files with 263 additions and 22 deletions

View File

@@ -103,16 +103,8 @@ public class CopyCommand : CommandBase, ITransportationCommand
_operationProgresses.Clear();
_operationProgresses.AddRange(calculateOperation.OperationStatuses);
_operationProgresses
.Select(op => op.Progress.Select(p => (Progress: p, TotalProgress: op.TotalCount)))
.CombineLatest()
.Select(data =>
{
var total = data.Sum(d => d.TotalProgress);
if (total == 0) return 0;
return (int)(data.Sum(d => d.Progress) * 100 / total);
})
.Subscribe(SetTotalProgress);
//TODO: Handle IDisposable
TrackProgress(_operationProgresses);
if (Sources.Count == 1)
@@ -127,6 +119,7 @@ public class CopyCommand : CommandBase, ITransportationCommand
.Subscribe(statuses =>
{
var done = statuses.Count(s => s) + 1;
if(done > statuses.Count) done = statuses.Count;
SetDisplayLabel($"Copy - {done} / {statuses.Count}");
});