Example #1
0
    public ICommandConfigurator AddCommand <TCommand>(string name)
        where TCommand : class, ICommand
    {
        var command = Commands.AddAndReturn(ConfiguredCommand.FromType <TCommand>(name, false));

        return(new CommandConfigurator(command));
    }
Example #2
0
    public ICommandConfigurator AddDelegate <TSettings>(string name, Func <CommandContext, TSettings, int> func)
        where TSettings : CommandSettings
    {
        var command = Commands.AddAndReturn(ConfiguredCommand.FromDelegate <TSettings>(
                                                name, (context, settings) => func(context, (TSettings)settings)));

        return(new CommandConfigurator(command));
    }