Command refactor

This commit is contained in:
2022-05-15 21:42:01 +02:00
parent 9a99aad030
commit f99f90783f
42 changed files with 544 additions and 217 deletions

View File

@@ -1,9 +0,0 @@
using FileTime.App.Core.Command;
namespace FileTime.App.Core.Services;
public interface ICommandHandler
{
bool CanHandleCommand(Command.Command command);
Task HandleCommandAsync(Command.Command command);
}

View File

@@ -1,8 +0,0 @@
using FileTime.App.Core.Command;
namespace FileTime.App.Core.Services;
public interface ICommandHandlerService
{
Task HandleCommandAsync(Command.Command command);
}

View File

@@ -0,0 +1,9 @@
using FileTime.App.Core.UserCommand;
namespace FileTime.App.Core.Services;
public interface IIdentifiableUserCommandService
{
void AddIdentifiableUserCommandFactory(string identifier, Func<IIdentifiableUserCommand> commandFactory);
IIdentifiableUserCommand GetCommand(string identifier);
}

View File

@@ -0,0 +1,9 @@
using FileTime.App.Core.UserCommand;
namespace FileTime.App.Core.Services;
public interface IUserCommandHandler
{
bool CanHandleCommand(IUserCommand command);
Task HandleCommandAsync(IUserCommand command);
}

View File

@@ -0,0 +1,7 @@
namespace FileTime.App.Core.Services;
public interface IUserCommandHandlerService
{
Task HandleCommandAsync(UserCommand.IUserCommand command);
Task HandleCommandAsync<TCommand>() where TCommand : UserCommand.IUserCommand, new();
}