/// <summary>
 /// Clicks the user-specified button or link and then waits for a window to close or open, or a page to load,
 /// depending on the button that was clicked
 /// </summary>
 /// <param name="buttonOrLinkElem">The element to click on</param>
 public dynamic ClickToAdvance(IWebElement buttonorElem)
 {
     if (Browser.Exists(Bys.AssignConfirmationPage.EditConfirmBtn))
     {
         if (buttonorElem.GetAttribute("outerHTML") == EditConfirmBtn.GetAttribute("outerHTML"))
         {
             Thread.Sleep(0500);
             EditConfirmBtn.Click();
             //Browser.WaitForElement(Bys.ProgramsPage.ProgramMngTbl, TimeSpan.FromSeconds(120), ElementCriteria.IsEnabled, ElementCriteria.IsVisible);
             //new WebDriverWait(Browser, TimeSpan.FromSeconds(15)).Until(ExpectedConditions.UrlContains("programs"));
             ProgramsPage PP = new ProgramsPage(Browser);
             PP.WaitForInitialize();
             return(PP);
         }
     }
     if (Browser.Exists(Bys.AssignConfirmationPage.ConfirmBtn))
     {
         if (buttonorElem.GetAttribute("outerHTML") == ConfirmBtn.GetAttribute("outerHTML"))
         {
             Thread.Sleep(0500);
             ConfirmBtn.Click();
             //Browser.WaitForElement(Bys.ProgramsPage.ProgramMngTbl, TimeSpan.FromSeconds(120), ElementCriteria.IsEnabled, ElementCriteria.IsVisible);
             //new WebDriverWait(Browser, TimeSpan.FromSeconds(15)).Until(ExpectedConditions.UrlContains("programs"));
             ProgramsPage PP = new ProgramsPage(Browser);
             PP.WaitForInitialize();
             return(PP);
         }
     }
     else
     {
         throw new Exception("No button or link was found with your passed parameter. You either need to add this button to a new If statement, or if the button is already added, then the page you were on did not contain the button.");
     }
     return(null);
 }
Esempio n. 2
0
 public ProgressBarForm(BackgroundWorker worker)
 {
     InitializeComponent();
     this.progressBarFormBgw = worker;
     this.progressBarFormBgw.ProgressChanged    += new ProgressChangedEventHandler(progressBarFormBgw_Changed);
     this.progressBarFormBgw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(progressBarFormBgw_Completed);
     ConfirmBtn.Hide();
 }
Esempio n. 3
0
        private void Caption_OnKeyUp(object sender, KeyEventArgs e)
        {
            var textBox = sender as CheckBox;

            if (e.Key == Key.Enter)
            {
                ConfirmBtn.Focus();
                Activate();
            }
        }
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
        {
            Debug.Log("hi");
//			if (InputField.isFocused) {
            ConfirmBtn.WasLeftClicked();
//			}
        }
    }
Esempio n. 5
0
 /// <summary>
 /// 键盘点击事件
 /// </summary>
 void Hook_OnKeyBoardActivity(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     HotKey.IsMouse = false;
     HotKey.KeyCode = e.KeyCode;
     HotKeyTag.Text = Application.Current.Resources["ChooseHotKeyPage_HotKeyTag"].ToString() + HotKey.KeyCode;
     hook.Stop();
     hook = null;
     ConfirmBtn.Focus();//设置完后应该转移焦点
     WaitHotKeyDrawer.IsOpen = false;
 }
        //private static IWebElement CancelBtn = Driver.FindElement(By.Id("dialogCancel"));
        #endregion

        internal void TerminateEmployment(string reason, string date, string note = null)
        {
            _logger.Info("Entering TerminateEmployment()");

            // Fill out dialog
            Reason.SendKeys(reason);
            Date.Clear();
            Date.SendKeys(date + Keys.Tab);
            Note.SendKeys(note);

            // Confirm the termination
            ConfirmBtn.Click();

            _logger.Info("Exiting TerminateEmployment()");
        }
Esempio n. 7
0
        public void Show(string title, string str, UnityEngine.Events.UnityAction confirmAction, UnityEngine.Events.UnityAction cancleAction)
        {
            Show();
            Title.text         = title;
            HotFixDesText.text = str;

            ConfirmBtn.OnPointerClickAsObservable().Subscribe(_ =>
            {
                confirmAction();
            }).AddTo(gameObject);

            CancleBtn.OnPointerClickAsObservable().Subscribe(_ =>
            {
                cancleAction();
                Hide();
            }).AddTo(gameObject);
        }
Esempio n. 8
0
 private void progressBarFormBgw_Completed(object sender, RunWorkerCompletedEventArgs e)
 {
     this.ControlBox = true;
     ConfirmBtn.Show();
     //this.Close();
 }