WIP CommandScheduler UI

This commit is contained in:
2023-01-31 23:26:36 +01:00
parent 06a9fc27d7
commit 30ecc6e515
37 changed files with 553 additions and 181 deletions

View File

@@ -5,7 +5,7 @@ using FileTime.Core.Timeline;
namespace FileTime.Core.Command.Delete;
public class DeleteCommand : IExecutableCommand
public class DeleteCommand : CommandBase, IExecutableCommand
{
private readonly IContentAccessorFactory _contentAccessorFactory;
private readonly ITimelessContentProvider _timelessContentProvider;
@@ -15,18 +15,19 @@ public class DeleteCommand : IExecutableCommand
public DeleteCommand(
IContentAccessorFactory contentAccessorFactory,
ITimelessContentProvider timelessContentProvider)
: base("Delete")
{
_contentAccessorFactory = contentAccessorFactory;
_timelessContentProvider = timelessContentProvider;
}
public Task<CanCommandRun> CanRun(PointInTime currentTime)
public override Task<CanCommandRun> CanRun(PointInTime currentTime)
{
//TODO
return Task.FromResult(CanCommandRun.True);
}
public Task<PointInTime> SimulateCommand(PointInTime currentTime)
public override Task<PointInTime> SimulateCommand(PointInTime currentTime)
{
//TODO
return Task.FromResult(currentTime);
@@ -38,8 +39,8 @@ public class DeleteCommand : IExecutableCommand
//Delete
await TraverseTree(
PointInTime.Present,
ItemsToDelete,
PointInTime.Present,
ItemsToDelete,
new Dictionary<string, IItemDeleter>(),
new DeleteStrategy()
);
@@ -69,9 +70,9 @@ public class DeleteCommand : IExecutableCommand
if (itemToDelete is IContainer container)
{
await TraverseTree(
currentTime,
(await container.Items.GetItemsAsync())?.Select(i => i.Path) ?? Enumerable.Empty<FullName>(),
itemDeleters,
currentTime,
(await container.Items.GetItemsAsync())?.Select(i => i.Path) ?? Enumerable.Empty<FullName>(),
itemDeleters,
deleteStrategy
);
}