private void SendTxt_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { SendBtn.PerformClick(); e.SuppressKeyPress = true; } }
public RegisterForm(Client client) { this.client = client; client.OnError += OnError; client.OnRegister += OnRegister; InitializeComponent(); SendBtn.Hide(); CodeTextBox.Hide(); }
private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) { SendBtn.PerformClick(); e.Handled = true; e.SuppressKeyPress = true; } }
private void Msg_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { if (SendBtn.IsEnabled) { SendBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); } // MessageBox.Show("XX"); } }
void OnRegister(bool mailNeeded) { Invoke(new Action(() => { if (mailNeeded) { CodeTextBox.Show(); SendBtn.Show(); Size = new Size(251, Size.Height); MessageBox.Show("Please Enter Code"); } else { MessageBox.Show("Registered!"); Close(); } })); }
internal void ChatWithOtherUser(IWebDriver driver) { // Populate the excel data into system GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "SignIn"); // Wait and click on Search icon GlobalDefinitions.WaitForElementClickable(driver, "XPath", "//i[@class='search link icon']", 10); SearchIcon.Click(); // Wait and Enter name in Search user part GlobalDefinitions.WaitForElement(driver, "XPath", "//input[@placeholder='Search user']", 10); SearchUserInput.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Name")); // Wait and Choosse the first one option Thread.Sleep(1500); DropdownFirstOpt.Click(); // Wait and Choose the first one result GlobalDefinitions.WaitForElement(driver, "XPath", "//*[@id='service-search-section']//div[2]/div/div/div[1]/a/img", 10); ResultFirstOpt.Click(); // Wait and click on Chat button GlobalDefinitions.WaitForElementClickable(driver, "XPath", "//a[@href='/Home/Message/?user=5fc9c489b2bb710001b08fb7']", 10); ChatBtnOnProfile.Click(); // Wait and input message in input area GlobalDefinitions.WaitForElement(driver, "Id", "chatTextBox", 10); ChatInputArea.SendKeys("Hi! Test!"); Thread.Sleep(500); // Click on send button SendBtn.Click(); // Extent report Base.test.Log(LogStatus.Pass, "Chat with other users successfully!"); }
public void ChatWithOtherUser(IWebDriver driver) { // Populate the excel data into system ExcelLib.PopulateInCollection(ConstantUtils.TestDataPath, "SignIn"); // Wait and click on Search icon WaitForElementClickable(driver, "XPath", "//i[@class='search link icon']", 10); SearchIcon.Click(); // Wait and Enter name in Search user part WaitForElement(driver, "XPath", "//input[@placeholder='Search user']", 10); SearchUserInput.SendKeys(ExcelLib.ReadData(3, "Name")); // Wait and Choosse the first one option Thread.Sleep(1500); DropdownFirstOpt.Click(); // Wait and Choose the first one result WaitForElement(driver, "XPath", "//*[@id='service-search-section']//div[2]/div/div/div[1]/a/img", 10); ResultFirstOpt.Click(); // Wait and click on Chat button WaitForElementClickable(driver, "XPath", "//a[@href='/Home/Message/?user=5fc9c489b2bb710001b08fb7']", 10); ChatBtnOnProfile.Click(); // Wait and input message in input area WaitForElement(driver, "Id", "chatTextBox", 10); ChatInputArea.SendKeys("Hi! Test!"); Thread.Sleep(500); // Click on send button SendBtn.Click(); }