public ICommandStrategy getStrategy(string command) { try { strategy = strategies[command]; } catch (KeyNotFoundException) { Console.WriteLine("Error: Given command is not supported."); } return(strategy); }
public void Execute(ICommandStrategy strategy, string path) { try { strategy.execute(path); } catch (DirectoryNotFoundException) { Console.WriteLine("Error: The directory specified could not be found."); } catch (ArgumentNullException) { Console.WriteLine("Error: The argument cannot be null or empty."); } }
public MainController( ISlackVerificationService slackVerificationService, ICommandStrategy commandStrategy, IEventFilterBuilder eventFilterBuilder, IDisappearingSlackMessageProvider disappearingSlackMessageProvider, IOptions <AppConfiguration> appConfiguration) { _slackVerificationService = slackVerificationService; _commandStrategy = commandStrategy; _eventFilter = eventFilterBuilder .AddBotFilter() .AddChangedFilter() .AddGroupDmFilter() .GetFilter(); _disappearingSlackMessageProvider = disappearingSlackMessageProvider; _accessToken = appConfiguration.Value.SlackBotUserAccessToken; }
public RobotControlProcessor(IParameterConvertor parameterConvertor, ICommandStrategy commandStrategy) { _parameterConvertor = parameterConvertor; _commandStrategy = commandStrategy; }
public RobotControlProcesser(IParameterConvertor parameterConvertor, ICommandStrategy commandStrategy) { this.parameterConvertor = parameterConvertor; this.commandStrategy = commandStrategy; }
public ConsensusCommandProvider(ICommandStrategy commandStrategy) { _commandStrategy = commandStrategy; }
public Task <Feedback> CommandAsync(UnsafeMethod method, ResourceBody body) { ICommandStrategy <IRestCollection> strategy = Context.Services.Strategies.ForCollections.GetOrThrow(method); return(strategy.ExecuteAsync(Collection, Context, body)); }
public void SetStrategy(ICommandStrategy strategy) { _strategy = strategy; }
public CommandContext(ICommandStrategy strategy) { _strategy = strategy; }