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)); }
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)); }