Delete command
This commit is contained in:
@@ -90,9 +90,10 @@ public class ItemManipulationUserCommandHandlerService : UserCommandHandlerServi
|
||||
else if (_currentSelectedItem?.BaseItem != null)
|
||||
{
|
||||
var item = _currentSelectedItem.BaseItem;
|
||||
_clipboardService.AddContent(item.FullName ??
|
||||
throw new ArgumentException($"{nameof(item.FullName)} can not be null.",
|
||||
nameof(item)));
|
||||
_clipboardService.AddContent(
|
||||
item.FullName
|
||||
?? throw new ArgumentException($"{nameof(item.FullName)} can not be null.", nameof(item))
|
||||
);
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
@@ -233,14 +234,12 @@ public class ItemManipulationUserCommandHandlerService : UserCommandHandlerServi
|
||||
return;
|
||||
}
|
||||
|
||||
var deleteCommand = new FileTime.Core.Command.Delete.DeleteCommand()
|
||||
{
|
||||
HardDelete = command.IsHardDelete
|
||||
};
|
||||
|
||||
|
||||
var deleteCommand = _serviceProvider.GetRequiredService<FileTime.Core.Command.Delete.DeleteCommand>();
|
||||
deleteCommand.HardDelete = command.IsHardDelete;
|
||||
deleteCommand.ItemsToDelete.AddRange(itemsToDelete!);
|
||||
await AddCommand(deleteCommand);
|
||||
|
||||
|
||||
_selectedTab?.ClearMarkedItems();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using FileTime.Core.Command;
|
||||
using FileTime.Core.Command.Copy;
|
||||
using FileTime.Core.Command.CreateContainer;
|
||||
using FileTime.Core.Command.CreateElement;
|
||||
using FileTime.Core.Command.Delete;
|
||||
using FileTime.Core.CommandHandlers;
|
||||
using FileTime.Core.ContentAccess;
|
||||
using FileTime.Core.Services;
|
||||
@@ -49,6 +50,7 @@ public static class DependencyInjection
|
||||
return serviceCollection
|
||||
.AddTransient<CreateContainerCommand>()
|
||||
.AddTransient<CreateElementCommand>()
|
||||
.AddTransient<CopyCommand>();
|
||||
.AddTransient<CopyCommand>()
|
||||
.AddTransient<DeleteCommand>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user