Ejemplo n.º 1
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));
    }
Ejemplo n.º 2
0
    public ICommandConfigurator AddDelegate <TDerivedSettings>(string name, Func <CommandContext, TDerivedSettings, int> func)
        where TDerivedSettings : TSettings
    {
        var command = ConfiguredCommand.FromDelegate <TDerivedSettings>(
            name, (context, settings) => func(context, (TDerivedSettings)settings));

        _command.Children.Add(command);
        return(new CommandConfigurator(command));
    }