Exemplo n.º 1
0
 public DatabaseTaskManager(IUserService userService, IApplicationState applicationState, ICommandExecutionService executionService, BackupHelper backupHelper)
 {
     this._userService      = userService;
     this._executionService = executionService;
     this._applicationState = applicationState;
     this._backupHelper     = backupHelper;
 }
        public OfferResynchronizationViewModel(ICommandExecutionService commandExecutionService)
        {
            this.commandExecutionService = commandExecutionService;

            AcceptCommand = new DelegateCommand(Accept);
            CancelCommand = new DelegateCommand(Cancel);
        }
Exemplo n.º 3
0
        public void OnConfigurationSaved(RepositoryMode repositoryMode, PluginConfigurationDialogResult configuration, IDialogService dialogService, ICommandExecutionService commandExecutionService)
        {
            if (repositoryMode != RepositoryMode.ClientServer) return;
            if (!configuration.IsEnabled) return;
            if (isEnabledBeforeConfig) return;

            dialogService.ShowDialog(new OfferResynchronizationViewModel(commandExecutionService));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new orchestrator
 /// </summary>
 /// <param name="context">The orchestation context</param>
 public CommandOrchestrator(IApplicationContext context, ICommandExecutionService <TSpec, TPayload> CommandPattern, CommandOrchestrationSettings Settings)
     : base(context)
 {
     this.CommandPattern = CommandPattern;
     this.cts            = new CancellationTokenSource();
     this.ct             = cts.Token;
     this.Settings       = Settings;
 }
Exemplo n.º 5
0
 public void Start(ICommandExecutionService pattern, CommandOrchestrationSettings Settings)
 {
     try
     {
         Orchestrators.GetOrAdd(pattern.SpecType, _ => GetOrchestrator(pattern, Settings ?? DefaultCommandSettings));
     }
     catch (Exception e)
     {
         Notify(OrchestrationStartError(pattern.SpecType, e));
     }
 }
Exemplo n.º 6
0
 public Option <ICommandOrchestrator> Orchestrator(ICommandExecutionService pattern, bool start, CommandOrchestrationSettings settings)
 => Try(() =>
 {
     var orcType = typeof(CommandOrchestrator <,>).MakeGenericType(pattern.SpecType, pattern.PayloadType);
     return(some((ICommandOrchestrator)Activator.CreateInstance(orcType, Context, pattern, settings)).OnSome(o =>
     {
         if (start)
         {
             o.Start();
         }
     }));
 });
Exemplo n.º 7
0
 public LevelEditingService(ILevelDataEditingService levelDataEditingService,
                            IMapEditingService mapEditingService,
                            IMapConfigRepository mapConfigRepository,
                            IMapGetService mapGetService,
                            ILevelDataRepository levelDataRepository,
                            ICommandExecutionService commandExecutionService)
 {
     _levelDataEditingService = levelDataEditingService;
     _mapEditingService       = mapEditingService;
     _mapConfigRepository     = mapConfigRepository;
     _mapGetService           = mapGetService;
     _levelDataRepository     = levelDataRepository;
     _commandExecutionService = commandExecutionService;
 }
Exemplo n.º 8
0
    IOption ExecuteCommand(ICommandExecutionService pattern, ICommandSpec command, bool save)
    {
        Notify(ExecutingCommand(command));

        if (save)
        {
            var saved = CommandStore?.SaveSpec(command);
            if (!saved.HasValue)
            {
                return(saved);
            }
            else if (!saved.Value)
            {
                return(saved);
            }
        }

        var expansion = command.ExpandVariables();
        var option    = pattern.TryExecute(expansion);

        if (option != null)
        {
            if (option.IsNone)
            {
                Notify(option.Message);
            }
            else
            {
                if (option.Message.IsEmpty)
                {
                    Notify(CompletedCommandExecution(command, option.Value));
                }
                else
                {
                    Notify(option.Message);
                }
            }
        }
        else
        {
            Notify(EmptyCommandResult(command));
        }
        return(option);
    }
 public CalculatorController(ICommandExecutionService commandExecutionService)
 {
     _commandExecutionService = commandExecutionService;
 }
 public void OnConfigurationSaved(RepositoryMode repositoryMode, PluginConfigurationDialogResult configuration, IDialogService dialogService, ICommandExecutionService commandExecutionService)
 {
     if (!previouslyEnabled && configuration.IsEnabled)
     {
         commandExecutionService.IssueCommand("RefreshNow");
     }
 }
Exemplo n.º 11
0
    ICommandOrchestrator GetOrchestrator(ICommandExecutionService pattern, CommandOrchestrationSettings Settings)
    {
        var orchestrator = C.CPS().Orchestrator(pattern, true, Settings);

        return(orchestrator.Require());;
    }
Exemplo n.º 12
0
 private void OnEnable()
 {
     _commandExecutionService = commandExecutionServiceProvider.Provide();
     _inGameMessageService    = inGameMessageServiceProvider.Provide();
 }
Exemplo n.º 13
0
 public CommandExecutor(IApplicationContext context, ICommandExecutionService <TSpec, TPayload> Pattern)
     : base(context)
 {
     this.Pattern = Pattern;
 }
 public SlashCommandController(IOptions <SlackSettings> slackSettings, ISignatureValidationService signatureValidationService, ICommandExecutionService commandExecutionService)
 {
     SlackSettings = slackSettings.Value;
     SignatureValidationService = signatureValidationService;
     CommandExecutionService    = commandExecutionService;
 }
Exemplo n.º 15
0
 ICommandOrchestrator <TSpec, TPayload> CreateOrchestration <TSpec, TPayload>
     (ICommandExecutionService <TSpec, TPayload> pattern, CommandOrchestrationSettings settings)
     where TSpec : CommandSpec <TSpec, TPayload>, new()
 => new CommandOrchestrator <TSpec, TPayload>(Context, pattern, settings);
Exemplo n.º 16
0
 ICommandQueueExecutor <TSpec> QueueExecutor <TSpec>(ICommandExecutionService <TSpec> pattern)
     where TSpec : CommandSpec <TSpec>, new()
 => new CommandQueueExecutor <TSpec>(Context, pattern);