Exemple #1
0
 public ICommandStrategy getStrategy(string command)
 {
     try
     {
         strategy = strategies[command];
     }
     catch (KeyNotFoundException)
     {
         Console.WriteLine("Error: Given command is not supported.");
     }
     return(strategy);
 }
Exemple #2
0
 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;
 }
Exemple #4
0
 public RobotControlProcessor(IParameterConvertor parameterConvertor, ICommandStrategy commandStrategy)
 {
     _parameterConvertor = parameterConvertor;
     _commandStrategy    = commandStrategy;
 }
Exemple #5
0
 public RobotControlProcesser(IParameterConvertor parameterConvertor, ICommandStrategy commandStrategy)
 {
     this.parameterConvertor = parameterConvertor;
     this.commandStrategy    = commandStrategy;
 }
Exemple #6
0
 public ConsensusCommandProvider(ICommandStrategy commandStrategy)
 {
     _commandStrategy = commandStrategy;
 }
Exemple #7
0
        public Task <Feedback> CommandAsync(UnsafeMethod method, ResourceBody body)
        {
            ICommandStrategy <IRestCollection> strategy = Context.Services.Strategies.ForCollections.GetOrThrow(method);

            return(strategy.ExecuteAsync(Collection, Context, body));
        }
Exemple #8
0
 public void SetStrategy(ICommandStrategy strategy)
 {
     _strategy = strategy;
 }
Exemple #9
0
 public CommandContext(ICommandStrategy strategy)
 {
     _strategy = strategy;
 }