public ActionManager(ILogger logger, IServicesConfig servicesConfig, IHttpClient httpClient)
 {
     this.emailActionExecutor = new EmailActionExecutor(
         servicesConfig,
         httpClient,
         logger);
 }
 public PackageProcessor(IActionExecutor actionExecutor, IConsoleWriter writer, INuGetProcess nugetProcess, RunContext runContext)
 {
     _actionExecutor = actionExecutor;
     _writer = writer;
     _nugetProcess = nugetProcess;
     _runContext = runContext;
 }
        public GeneralOptionsControl(Lifetime lifetime,
                                     OptionsSettingsSmartContext ctx,
                                     IActionExecutor actionExecutor,
                                     KaVEISettingsStore settingsStore,
                                     DataContexts dataContexts,
                                     IMessageBoxCreator messageBoxCreator)
        {
            _messageBoxCreator = messageBoxCreator;
            _lifetime          = lifetime;
            _ctx            = ctx;
            _actionExecutor = actionExecutor;
            _settingsStore  = settingsStore;
            _dataContexts   = dataContexts;

            InitializeComponent();

            _exportSettings = settingsStore.GetSettings <ExportSettings>();

            DataContext = new GeneralOptionsViewModel
            {
                ExportSettings = _exportSettings
            };

            if (_ctx != null)
            {
                BindToGeneralChanges();
            }
        }
 public CommandLineRunner(IConsoleWriter writer, IPackageProcessor packageProcessor, IActionExecutor actionExecutor, RunContext runContext)
 {
     _writer = writer;
     _packageProcessor = packageProcessor;
     _actionExecutor = actionExecutor;
     _runContext = runContext;
 }
        public void SelectionSelectBySymbol()
        {
            driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("single_text_input.html");

            IWebElement input = driver.FindElement(By.Id("textInput"));

            new Actions(driver).Click(input).SendKeys("abc def").Perform();

            WaitFor(() => input.GetAttribute("value") == "abc def", "did not send initial keys");

            if (!TestUtilities.IsInternetExplorer(driver))
            {
                // When using drivers other than the IE, the click in
                // the below action sequence may fall inside the double-
                // click threshold (the IE driver has guards to prevent
                // inadvertent double-clicks with multiple actions calls),
                // so we call the "release actions" end point before
                // doing the second action.
                IActionExecutor executor = driver as IActionExecutor;
                if (executor != null)
                {
                    executor.ResetInputState();
                }
            }

            new Actions(driver).Click(input)
            .KeyDown(Keys.Shift)
            .SendKeys(Keys.Left)
            .SendKeys(Keys.Left)
            .KeyUp(Keys.Shift)
            .SendKeys(Keys.Delete)
            .Perform();

            Assert.That(input.GetAttribute("value"), Is.EqualTo("abc d"));
        }
        public void SelectionSelectByWord()
        {
            driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("single_text_input.html");

            IWebElement input = driver.FindElement(By.Id("textInput"));

            new Actions(driver).Click(input).SendKeys("abc def").Perform();

            WaitFor(() => input.GetAttribute("value") == "abc def", "did not send initial keys");

            if (TestUtilities.IsFirefox(driver))
            {
                // When using geckodriver, the click in the below action
                // sequence may fall inside the double-click threshold,
                // so we call the "release actions" end point before
                // doing the second action.
                IActionExecutor executor = driver as IActionExecutor;
                if (executor != null)
                {
                    executor.ResetInputState();
                }
            }

            new Actions(driver).Click(input)
            .KeyDown(Keys.Shift)
            .KeyDown(Keys.Control)
            .SendKeys(Keys.Left)
            .KeyUp(Keys.Control)
            .KeyUp(Keys.Shift)
            .SendKeys(Keys.Delete)
            .Perform();

            WaitFor(() => input.GetAttribute("value") == "abc ", "did not send editing keys");
        }
        public UsageModelOptionsControl(Lifetime lifetime,
                                        OptionsSettingsSmartContext ctx,
                                        KaVEISettingsStore settingsStore,
                                        IActionExecutor actionExecutor,
                                        DataContexts dataContexts,
                                        IMessageBoxCreator messageBoxCreator)
        {
            _messageBoxCreator = messageBoxCreator;
            _lifetime          = lifetime;
            _settingsStore     = settingsStore;
            _actionExecutor    = actionExecutor;
            _dataContexts      = dataContexts;
            InitializeComponent();

            _modelStoreSettings = settingsStore.GetSettings <ModelStoreSettings>();

            DataContext = new UsageModelOptionsViewModel
            {
                ModelStoreSettings = _modelStoreSettings
            };

            if (ctx != null)
            {
                // Binding to ModelStorePath
                ctx.SetBinding(
                    lifetime,
                    (ModelStoreSettings s) => s.ModelStorePath,
                    ModelStorePathTextBox,
                    TextBox.TextProperty);
            }
        }
        public UserProfileOptionsControl(Lifetime lifetime,
                                         OptionsSettingsSmartContext ctx,
                                         KaVEISettingsStore settingsStore,
                                         IActionExecutor actionExecutor,
                                         DataContexts dataContexts,
                                         IMessageBoxCreator messageBoxCreator,
                                         IUserProfileSettingsUtils userProfileUtils)
        {
            _messageBoxCreator = messageBoxCreator;
            _userProfileUtils  = userProfileUtils;
            _lifetime          = lifetime;
            _ctx            = ctx;
            _settingsStore  = settingsStore;
            _actionExecutor = actionExecutor;
            _dataContexts   = dataContexts;

            InitializeComponent();

            userProfileUtils.EnsureProfileId();

            _userProfileSettings = userProfileUtils.GetSettings();

            _userProfileContext = new UserProfileContext(_userProfileSettings, userProfileUtils);
            _userProfileContext.PropertyChanged += UserProfileContextOnPropertyChanged;

            DataContext = _userProfileContext;

            if (_ctx != null)
            {
                BindToUserProfileChanges();
            }
        }
Beispiel #9
0
        public AnonymizationOptionsControl(Lifetime lifetime,
                                           OptionsSettingsSmartContext ctx,
                                           KaVEISettingsStore settingsStore,
                                           IActionExecutor actionExecutor,
                                           DataContexts dataContexts,
                                           IMessageBoxCreator messageBoxCreator)
        {
            _lifetime       = lifetime;
            _ctx            = ctx;
            _settingsStore  = settingsStore;
            _actionExecutor = actionExecutor;
            _dataContexts   = dataContexts;

            InitializeComponent();

            _anonymizationSettings = settingsStore.GetSettings <AnonymizationSettings>();

            var anonymizationContext = new AnonymizationContext(_anonymizationSettings);

            DataContext = anonymizationContext;

            if (_ctx != null)
            {
                BindChangesToAnonymization();
            }

            _messageBoxCreator = messageBoxCreator;
        }
Beispiel #10
0
        public static async Task <TResponse> ExecuteAsync <TAction, TResponse>(
            this IActionExecutor executor)
            where TResponse : class
        {
            var typeName = ActionBase.GetName(typeof(TAction));

            return((await executor.ExecuteAsync(typeName)) as TResponse);
        }
Beispiel #11
0
 public void SetupTest()
 {
     IActionExecutor actionExecutor = driver as IActionExecutor;
     if (actionExecutor != null)
     {
         actionExecutor.ResetInputState();
     }
 }
        public void SetUp()
        {
            _settings = new UserProfileSettings();
            _util     = Mock.Of <IUserProfileSettingsUtils>();
            Mock.Get(_util).Setup(u => u.GetSettings()).Returns(_settings);

            _actionExecutor     = Mock.Of <IActionExecutor>();
            _uploadWizardPolicy = UploadWizardPolicy.OpenUploadWizardOnFinish;
        }
 public TaskContext(TaskId id, ITask task, IActionExecutor executor)
 {
     _task         = task;
     _id           = id;
     _guard        = new object();
     _cancellation = new CancellationTokenSource();
     _state        = State.Created;
     _executor     = executor;
 }
Beispiel #14
0
 public Player(PlayerConfig playerConfig, IGameService gameService, IMessageProvider messageProvider, PlayerState playerState, IActionExecutor actionExecutor, AbstractStrategy strategy)
 {
     _gameService     = gameService;
     _messageProvider = messageProvider;
     _playerConfig    = playerConfig;
     _playerState     = playerState;
     _actionExecutor  = actionExecutor;
     _strategy        = strategy;
 }
        public GeofenceBackgroundTask()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            SimpleIoc.Default.ConfigureBusiness();

            _dataContextManager = SimpleIoc.Default.GetInstance<IDataContextManager>();
            _actionExecutor = SimpleIoc.Default.GetInstance<IActionExecutor>();
            _logger = SimpleIoc.Default.GetInstance<ILogger>();
        }
Beispiel #16
0
        public GeofenceBackgroundTask()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            SimpleIoc.Default.ConfigureBusiness();

            _dataContextManager = SimpleIoc.Default.GetInstance <IDataContextManager>();
            _actionExecutor     = SimpleIoc.Default.GetInstance <IActionExecutor>();
            _logger             = SimpleIoc.Default.GetInstance <ILogger>();
        }
        public void Setup()
        {
            new Actions(driver).SendKeys(Keys.Null).Perform();
            IActionExecutor actionExecutor = driver as IActionExecutor;

            if (actionExecutor != null)
            {
                actionExecutor.ResetInputState();
            }
        }
        public void ReleaseModifierKeys()
        {
            // new Actions(driver).SendKeys(Keys.Null).Perform();
            IActionExecutor actionExecutor = driver as IActionExecutor;

            if (actionExecutor != null)
            {
                actionExecutor.ResetInputState();
            }
        }
        private static FlowToken Execute(IActionExecutor actionExecutor, EntityToken entityToken, ActionToken actionToken, FlowControllerServicesContainer flowControllerServicesContainer)
        {
            FlowToken result = actionExecutor.Execute(entityToken, actionToken, flowControllerServicesContainer);

            if (result == null)
            {
                result = new NullFlowToken();
            }

            return(result);
        }
Beispiel #20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Actions"/> class.
        /// </summary>
        /// <param name="driver">The <see cref="IWebDriver"/> object on which the actions built will be performed.</param>
        public Actions(IWebDriver driver)
        {
            IActionExecutor actionExecutor = GetDriverAs <IActionExecutor>(driver);

            if (actionExecutor == null)
            {
                throw new ArgumentException("The IWebDriver object must implement or wrap a driver that implements IActionExecutor.", nameof(driver));
            }

            this.actionExecutor = actionExecutor;
        }
Beispiel #21
0
        public void SetupTest()
        {
            IActionExecutor actionExecutor = driver as IActionExecutor;

            if (actionExecutor != null)
            {
                actionExecutor.ResetInputState();
            }
            driver.SwitchTo().DefaultContent();
            ((IJavaScriptExecutor)driver).ExecuteScript("window.scrollTo(0, 0)");
        }
        public ToDoViewPresenter(ITodoView view, IToDoItemRepository repository, IActionExecutor actionExecutor, IMessageBoxPresenter messageBoxPresenter)
        {
            _view                = view ?? throw new ArgumentNullException(nameof(view));
            _repository          = repository ?? throw new ArgumentNullException(nameof(repository));
            _actionExecutor      = actionExecutor ?? throw new ArgumentNullException(nameof(actionExecutor));
            _messageBoxPresenter = messageBoxPresenter ?? throw new ArgumentNullException(nameof(messageBoxPresenter));

            view.CloseButtonClick += view.Dispose;
            view.AddButtonClick   += OnAddButtonClick;
            view.ToDoItemChecked  += OnChangeItemChecked;
            view.Loaded           += OnLoaded;
        }
 public SMTPImpostorHubService(
     ILogger <SMTPImpostorHubService> logger,
     IActionExecutor executor,
     SMTPImpostorSerialization serialization)
 {
     _logger           = logger;
     _executor         = executor;
     _serialization    = serialization;
     _clients          = new BehaviorSubject <IImmutableList <ISMTPImpostorHubClient> >(ImmutableList <ISMTPImpostorHubClient> .Empty);
     _messages         = new Subject <SMTPImpostorHubMessage>();
     _messageSemaphore = new SemaphoreSlim(1);
 }
Beispiel #24
0
        /// <summary>
        /// Performs the currently built action.
        /// </summary>
        public async Task Perform(CancellationToken cancellationToken = default(CancellationToken))
        {
            IActionExecutor actionExecutor = this.driver as IActionExecutor;

            if (await actionExecutor.IsActionExecutor(cancellationToken).ConfigureAwait(false))
            {
                await actionExecutor.PerformActions(this.actionBuilder.ToActionSequenceList()).ConfigureAwait(false);
            }
            else
            {
                await action.Perform().ConfigureAwait(false);
            }
        }
Beispiel #25
0
        public void Perform()
        {
            IActionExecutor actionExecutor = this.driver as IActionExecutor;

            if (actionExecutor.IsActionExecutor)
            {
                actionExecutor.PerformActions(this.actionBuilder.ToActionSequenceList());
            }
            else
            {
                this.action.Perform();
            }
        }
Beispiel #26
0
 public JobRunner(ITokenReplacerFactory tokenReplacerFactory,
                  IConverterFactory converterFactory, IJobCleanUp jobClean, ITempFolderProvider tempFolderProvider, IDirectory directory,
                  IDirectoryHelper directoryHelper, IPdfProcessingHelper processingHelper, IActionExecutor actionExecutor)
 {
     _tokenReplacerFactory = tokenReplacerFactory;
     _converterFactory     = converterFactory;
     _jobClean             = jobClean;
     _tempFolderProvider   = tempFolderProvider;
     _directory            = directory;
     _directoryHelper      = directoryHelper;
     _processingHelper     = processingHelper;
     _actionExecutor       = actionExecutor;
 }
Beispiel #27
0
 public SMTPImpostorWorkerService(
     ILogger <SMTPImpostorWorkerService> logger,
     ISMTPImpostorWorkerSettings settings,
     SMTPImpostor impostor,
     SMTPImpostorHubService hub,
     IActionExecutor executor,
     ISMTPImpostorHostSettingsStore hostsSettings)
 {
     _logger        = logger;
     _settings      = settings;
     _impostor      = impostor;
     _hub           = hub;
     _executor      = executor;
     _hostsSettings = hostsSettings;
 }
        public UploadWizardControl(UploadWizardContext dataContext,
                                   ISettingsStore settingsStore,
                                   IActionExecutor actionExec,
                                   IUserProfileSettingsUtils userProfileUtil)
        {
            InitializeComponent();

            _settingsStore   = settingsStore;
            _actionExec      = actionExec;
            _userProfileUtil = userProfileUtil;

            DataContext = dataContext;
            MyDataContext.PropertyChanged += OnViewModelPropertyChanged;
            MyDataContext.ErrorNotificationRequest.Raised   += new NotificationRequestHandler(this).Handle;
            MyDataContext.SuccessNotificationRequest.Raised += new LinkNotificationRequestHandler(this).Handle;
        }
Beispiel #29
0
        public UserProfileDialog(IActionExecutor actionExec,
                                 UploadWizardPolicy policy,
                                 IUserProfileSettingsUtils userProfileUtils)
        {
            _actionExec = actionExec;
            _policy     = policy;

            InitializeComponent();

            _userProfileSettingsUtils = userProfileUtils;
            _userProfileSettings      = _userProfileSettingsUtils.GetSettings();

            var userProfileContext = new UserProfileContext(_userProfileSettings, _userProfileSettingsUtils);

            DataContext = userProfileContext;
        }
Beispiel #30
0
 public static void Execute(IAction action)
 {
     using (frmPropertyEditorDialog frm = new frmPropertyEditorDialog())
     {
         IPropertyEditorDialog dlg = frm as IPropertyEditorDialog;
         bool isOk = dlg.ShowDialog(action, null);
         if (isOk)
         {
             using (frmActionExecutor exefrm = new frmActionExecutor())
             {
                 IActionExecutor exe = exefrm as IActionExecutor;
                 exe.Queue(action);
                 exefrm.ShowDialog();
             }
         }
     }
 }
Beispiel #31
0
 private void DirectExecute(ActionInfo actionInfo)
 {
     using (frmPropertyEditorDialog frm = new frmPropertyEditorDialog())
     {
         IPropertyEditorDialog dlg = frm as IPropertyEditorDialog;
         IAction action            = actionInfo.ToAction();
         bool    isOk = dlg.ShowDialog(action, null);
         if (isOk)
         {
             using (frmActionExecutor exefrm = new frmActionExecutor())
             {
                 IActionExecutor exe = exefrm as IActionExecutor;
                 exe.Queue(action);
                 exefrm.ShowDialog();
             }
         }
     }
 }
Beispiel #32
0
 internal Session(
     INetwork network,
     IAgendaInternal agenda,
     IWorkingMemory workingMemory,
     IEventAggregator eventAggregator,
     IActionExecutor actionExecutor,
     IDependencyResolver dependencyResolver,
     IActionInterceptor actionInterceptor)
 {
     _network           = network;
     _workingMemory     = workingMemory;
     _agenda            = agenda;
     _eventAggregator   = eventAggregator;
     _actionExecutor    = actionExecutor;
     _executionContext  = new ExecutionContext(this, _workingMemory, _agenda, _eventAggregator);
     DependencyResolver = dependencyResolver;
     ActionInterceptor  = actionInterceptor;
 }
        protected virtual IAsyncResult OnBeginExecute(AsyncCallback callback, object state)
        {
            LoadTempData();

            try
            {
                string actionName = RouteData.GetRequiredValue <string>("action");

                IActionExecutor      executor      = ActionExecutor;
                IAsyncActionExecutor asyncExecutor = (executor as IAsyncActionExecutor);

                if (asyncExecutor != null)
                {
                    BeginInvokeDelegate beginDelegate = delegate(AsyncCallback asyncCallback, object asyncState) {
                        return(asyncExecutor.BeginInvokeAction(Context, actionName, asyncCallback, asyncState, new ValueDictionary()));
                    };
                    EndInvokeDelegate endDelegate = delegate(IAsyncResult asyncResult) {
                        if (!asyncExecutor.EndInvokeAction(asyncResult))
                        {
                            HandleUnknownAction(actionName);
                        }
                    };
                    return(AsyncResultWrapper.Begin(callback, state, beginDelegate, endDelegate, _tag));
                }
                else
                {
                    Action action = () => {
                        if (!executor.InvokeAction(Context, actionName, null))
                        {
                            HandleUnknownAction(actionName);
                        }
                    };
                    return(AsyncResultWrapper.BeginSynchronous(callback, state, action, _tag));
                }
            }
            catch
            {
                SaveTempData();
                throw;
            }
        }
        private static FlowToken Execute(IActionExecutor actionExecutor, EntityToken entityToken, ActionToken actionToken, FlowControllerServicesContainer flowControllerServicesContainer)
        {
            FlowToken result = actionExecutor.Execute(entityToken, actionToken, flowControllerServicesContainer);

            if (result == null)
            {
                result = new NullFlowToken();
            }

            return result;
        }