33 lines
659 B
C#
33 lines
659 B
C#
using ExcelTableImporter.Models.ExcelModels;
|
|
|
|
namespace ExcelTableImporter.Commands;
|
|
|
|
public interface ICommand
|
|
{
|
|
string HelpText { get; }
|
|
string UsageText { get; }
|
|
}
|
|
|
|
public interface ICommandHandler
|
|
{
|
|
void Handle();
|
|
}
|
|
|
|
public abstract class AnimeLibraryCommandHandlerBase<T>(AnimeLibrary library, T command) : ICommandHandler
|
|
where T : ICommand
|
|
{
|
|
protected readonly AnimeLibrary Library = library;
|
|
|
|
public void Handle()
|
|
{
|
|
try
|
|
{
|
|
Handle(command);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine(ex.Message);
|
|
}
|
|
}
|
|
protected abstract void Handle(T command);
|
|
} |