示例#1
0
 protected void ChangeFocus()
 {
     _focusElement.Focus();
     if (UserGotFocus != null)
     {
         UserGotFocus.Invoke(this, null);
     }
 }
示例#2
0
        private void SearchNext()
        {
            if (queuedSearches.Count == 0)
            {
                ExportToExcel();
                MessageBox.Show("Search Completed! Data Exported to Selected Location.", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                currentSearch++;
                UpdateSearchStatus();

                string strKeyword = queuedSearches[0].Split(':')[0];
                string strCountry = queuedSearches[0].Split(':')[1];

                if (!string.IsNullOrEmpty(strKeyword) && !string.IsNullOrEmpty(strCountry))
                {
                    Log.Information("Searching for Keyword '{0}' in Country '{1}'", strKeyword, strCountry);

                    lbl_Search_Keyword.Text = strKeyword;
                    lbl_Search_Country.Text = strCountry;
                    currentCountry          = strCountry;

                    GeckoInputElement keyword = (GeckoInputElement)Browser.Document.GetElementById("memberKeywords");
                    GeckoHtmlElement  country = (GeckoHtmlElement)Browser.Document.GetElementById("memberIdCountry");
                    GeckoHtmlElement  submit  = (GeckoHtmlElement)Browser.Document.GetElementById("searchConnections");

                    keyword.Click();
                    keyword.Focus();
                    keyword.Value = strKeyword;

                    this.Focus();
                    Browser.Focus();
                    country.Focus();
                    SendKeys.SendWait(strCountry);

                    submit.Focus();
                    submit.Click();
                }

                queuedSearches.RemoveAt(0);
            }
        }