public void SendMessage(string messageText) { MessageTextArea.Click(); MessageTextArea.Clear(); MessageTextArea.SendKeys(messageText); SendButton.Click(); }
private async void SendButton_Click(object sender, RoutedEventArgs e) { SendButton.IsEnabled = false; SendButton.Focus(); var result = await PostApi.AddComment( SettingsManager.PersistentSettings.CurrentUser.Token, PostId, ContentTextBox.Text, IsAnonymous) .ConfigureAwait(true); if (result.IsError) { await DialogManager.ShowErrorDialog(result.Message) .ConfigureAwait(true); SendButton.IsEnabled = true; return; } ContentTextBox.Text = string.Empty; RaiseEvent(new RoutedEventArgs(CommentAddEvent)); ContentTextBox.Focus(); SendButton.IsEnabled = true; }
/// <summary> /// Constructor /// </summary> /// <param name="w">The window</param> /// <param name="path">The file</param> public SendToViewModel(SendToWindow w, string path) { Content = new ChooseRecipient(); Button = new SendButton(this); SendWindow = w; ClickedPath = path; }
void ReleaseDesignerOutlets() { if (ConnectDisconnectButton != null) { ConnectDisconnectButton.Dispose(); ConnectDisconnectButton = null; } if (MessagesTableView != null) { MessagesTableView.Dispose(); MessagesTableView = null; } if (MessageTextField != null) { MessageTextField.Dispose(); MessageTextField = null; } if (SendButton != null) { SendButton.Dispose(); SendButton = null; } if (ServerUrlTextField != null) { ServerUrlTextField.Dispose(); ServerUrlTextField = null; } }
private void MessageTextBoxKeyDownHandler(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { SendButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); } }
void ReleaseDesignerOutlets() { if (PickerView != null) { PickerView.Dispose(); PickerView = null; } if (ResponseText != null) { ResponseText.Dispose(); ResponseText = null; } if (SendButton != null) { SendButton.Dispose(); SendButton = null; } if (SRDOText != null) { SRDOText.Dispose(); SRDOText = null; } }
void ReleaseDesignerOutlets() { if (NewMessageTextField != null) { NewMessageTextField.Dispose(); NewMessageTextField = null; } if (SendButton != null) { SendButton.Dispose(); SendButton = null; } if (RefreshButton != null) { RefreshButton.Dispose(); RefreshButton = null; } if (TableView != null) { TableView.Dispose(); TableView = null; } }
private void MessageInput_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { SendButton.PerformClick(); } }
private void InputTextBox_OnKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { SendButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // http://stackoverflow.com/questions/728432/how-to-programmatically-click-a-button-in-wpf } }
private void ChinSuaDaiLy_Load(object sender, EventArgs e) { if (dataGridView1.Rows.Count >= 0) { dataGridView1.Rows[0].Selected = true; } SendButton.Hide(); }
private void SendFieldKeyDown(object sender, KeyEventArgs e) { // 엔터키 입력시 버튼과 같은 효과 if (e.KeyCode == Keys.Enter) { SendButton.PerformClick(); } }
/* * send message and update message history on click */ private void SendChatBtn_Click(object sender, RoutedEventArgs e) { ChatMessage sentMessage = SendButton.SendClicked(InputBox, chatMessages); if (sentMessage.Message != null && connected) { chatListBox.NewOutgoingChatMessage(sentMessage, chatMessages, CLP); } }
/*************************** Game Lobby ************************************** * initializes the lobby and allows only the exit button and the login button the * be available before connecting to the server. */ public gameLobby() { InitializeComponent(); CreateButton.Hide(); ListGamesButton.Hide(); JoinButton.Hide(); SendButton.Hide(); this.AcceptButton = SendButton; } // end of gameLobby
void ReleaseDesignerOutlets() { if (CloseButton != null) { CloseButton.Dispose(); CloseButton = null; } if (ErrorView != null) { ErrorView.Dispose(); ErrorView = null; } if (FeedbackPlaceholderTextView != null) { FeedbackPlaceholderTextView.Dispose(); FeedbackPlaceholderTextView = null; } if (FeedbackTextView != null) { FeedbackTextView.Dispose(); FeedbackTextView = null; } if (IndicatorView != null) { IndicatorView.Dispose(); IndicatorView = null; } if (SendButton != null) { SendButton.Dispose(); SendButton = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } if (ErrorTitleLabel != null) { ErrorTitleLabel.Dispose(); ErrorTitleLabel = null; } if (ErrorMessageLabel != null) { ErrorMessageLabel.Dispose(); ErrorMessageLabel = null; } }
private void TextBox_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter && e.KeyboardDevice.Modifiers == ModifierKeys.None) { SendButton.Focus(); ((ChatViewModel)SendButton.DataContext).SendCommand.Execute(null); ((TextBox)sender).Focus(); } }
private void EditAgency_Load(object sender, EventArgs e) { portionBindingSource.DataSource = agency.Portions; portionBindingSource.ResetBindings(false); if (dataGridView1.Rows.Count > 0) { dataGridView1.Rows[0].Selected = true; } SendButton.Hide(); }
void CheckIfSend() { sendButton = sendButtonG.GetComponent <SendButton>(); if (sendButton.hasBeenSend == true) { //LegitCombination(); Debug.Log("in the iff"); } sendButton.hasBeenSend = false; }
private void requestTextBox_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 0xD) { if (requestTextBox.Text != "" && requestTextBox.Text != " ") { e.Handled = true; SendButton.PerformClick(); } } }
private void SendRadioButton_CheckedChanged(object sender, EventArgs e) { if (SendRadioButton.Checked) { SendButton.Show(); TakeButton.Hide(); SelectFileButton.Hide(); SelectedFileTextBox.Hide(); } SelectedFileTextBox.Clear(); }
private void ContentTextBox_KeyUp(object sender, KeyEventArgs e) { if (Keyboard.Modifiers.HasFlag(ModifierKeys.Control) && e.Key == Key.Enter) { if (SendButton.IsEnabled) { SendButton.Focus(); SendButton_Click(this, new RoutedEventArgs()); } } }
public void SendClickedTest() { TextBox tb = new TextBox(); tb.Text = "Some test input"; ListBox lb = new ListBox(); var output = SendButton.SendClicked(tb, lb); Assert.IsNotNull(output); Assert.IsInstanceOfType(output, typeof(ChatMessage)); }
} // end of sendButton /*************************** Login Button ************************************* * Takes the users name they typed in the username textbox and requests a connction * with the server, then logs in to the server enabling the create button, list * games button, and join button. */ private void LoginButton_Click_1(object sender, EventArgs e) { // handle a blank username and don't allow people to have names longer than 16 characters if (textBox3.Text.Trim() == "") { textBox1.Text = "Please enter a Username before logging in"; return; } if (textBox3.Text.Length > 16) { textBox1.Text = "You shall not enter names longer than 16 characters!"; return; } // Username is what was typed into the textbox clientNo = textBox3.Text; try { // Try to connect to the server clientSocket.Connect("18.216.181.228", 13000); // *** Loopback can be uncommented out for testing on local machine *** // just make sure you comment out the IP above //clientSocket.Connect("127.0.0.1", 13000); serverStream = clientSocket.GetStream(); // Send the user name to the server byte[] outStream = System.Text.Encoding.ASCII.GetBytes(textBox3.Text + "|"); serverStream.Write(outStream, 0, outStream.Length); serverStream.Flush(); // Create a new thread top handle the client Thread ctThread = new Thread(getMessage); ctThread.Start(); } catch (Exception ex) { textBox1.AppendText(ex.ToString()); } if (clientSocket.Connected) { // If the client connects successfully, enables button functions LoginButton.Hide(); CreateButton.Show(); ListGamesButton.Show(); JoinButton.Show(); SendButton.Show(); } } // end of LoginButton
void ReleaseDesignerOutlets() { if (CameraButton != null) { CameraButton.Dispose(); CameraButton = null; } if (ChatBackground != null) { ChatBackground.Dispose(); ChatBackground = null; } if (ChatScrollView != null) { ChatScrollView.Dispose(); ChatScrollView = null; } if (GalleryButton != null) { GalleryButton.Dispose(); GalleryButton = null; } if (LoadingIndicatorView != null) { LoadingIndicatorView.Dispose(); LoadingIndicatorView = null; } if (SendButton != null) { SendButton.Dispose(); SendButton = null; } if (SmileyButton != null) { SmileyButton.Dispose(); SmileyButton = null; } if (TextField != null) { TextField.Dispose(); TextField = null; } }
/// <summary> /// Method, which find needed buttons ,and send message /// </summary> /// <param name="answerpsevdonim"></param> public void TextingAnswerMessageToMail(string answerpsevdonim) { Wait.Until(t => Driver.FindElements(By.XPath(Locator.AnswerButtonLocator)).Any()); IncomingButton = Driver.FindElement(By.XPath(Locator.AnswerButtonLocator)); IncomingButton.Click(); Wait.Until(t => Driver.FindElements(By.XPath(Locator.TextBoxLocator)).Any()); TextBoxLabel = Driver.FindElement(By.XPath(Locator.TextBoxLocator)); TextBoxLabel.SendKeys(answerpsevdonim); Wait.Until(t => Driver.FindElements(By.XPath(Locator.SendButtonLocator)).Any()); SendButton = Driver.FindElement(By.XPath(Locator.SendButtonLocator)); SendButton.Click(); }
private void MessageInputBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.Enter) { int caret = MessageInputBox.CaretIndex; MessageInputBox.Text = MessageInputBox.Text.Insert(caret, Environment.NewLine); MessageInputBox.CaretIndex = caret + Environment.NewLine.Length; return; } if (e.Key == Key.Enter) { SendButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); } }
public ChatInputView() { TextView = new UITextView(); TextView.Changed += OnTextChanged; TextView.Started += OnTextChanged; TextView.Ended += OnTextChanged; TextView.Layer.BorderColor = InputBorderColor.CGColor; TextView.Layer.BorderWidth = BorderWidth; TextView.Layer.CornerRadius = CornerRadius; TextView.BackgroundColor = InputBackgroundColor; TextView.TranslatesAutoresizingMaskIntoConstraints = false; TextView.ScrollIndicatorInsets = new UIEdgeInsets(CornerRadius, 0, CornerRadius, 0); TextView.TextContainerInset = new UIEdgeInsets(4, 2, 4, 2); TextView.ContentInset = new UIEdgeInsets(1, 0, 1, 0); TextView.ScrollEnabled = true; TextView.ScrollsToTop = false; TextView.UserInteractionEnabled = true; TextView.Font = UIFont.SystemFontOfSize(16); TextView.TextAlignment = UITextAlignment.Natural; TextView.ContentMode = UIViewContentMode.Redraw; SendButton = new SendButton(); SendButton.SetImage(UIImage.FromBundle("sendTextIcon"), UIControlState.Normal); SendButton.TranslatesAutoresizingMaskIntoConstraints = false; AddSubviews(TextView, SendButton); var c1 = NSLayoutConstraint.FromVisualFormat("H:|-[input]-[button]-|", NSLayoutFormatOptions.DirectionLeadingToTrailing, "input", TextView, "button", SendButton ); // var c2 = NSLayoutConstraint.FromVisualFormat ("V:|-[input]-|", // NSLayoutFormatOptions.DirectionLeadingToTrailing, // "input", TextView // ); // AddConstraints (c2); var top = NSLayoutConstraint.Create(TextView, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1, 7); var bot = NSLayoutConstraint.Create(TextView, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, this, NSLayoutAttribute.Bottom, 1, -7); AddConstraint(top); AddConstraint(bot); // We want Send button was centered when Toolbar has MinHeight (pin button in this state) var c3 = NSLayoutConstraint.Create(SendButton, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.Bottom, 1, -ToolbarMinHeight / 2); AddConstraints(c1); AddConstraint(c3); }
public ChatInputView() { TextView = new UITextView (); TextView.Changed += OnTextChanged; TextView.Started += OnTextChanged; TextView.Ended += OnTextChanged; TextView.Layer.BorderColor = InputBorderColor.CGColor; TextView.Layer.BorderWidth = BorderWidth; TextView.Layer.CornerRadius = CornerRadius; TextView.BackgroundColor = InputBackgroundColor; TextView.TranslatesAutoresizingMaskIntoConstraints = false; TextView.ScrollIndicatorInsets = new UIEdgeInsets (CornerRadius, 0, CornerRadius, 0); TextView.TextContainerInset = new UIEdgeInsets (4, 2, 4, 2); TextView.ContentInset = new UIEdgeInsets (1, 0, 1, 0); TextView.ScrollEnabled = true; TextView.ScrollsToTop = false; TextView.UserInteractionEnabled = true; TextView.Font = UIFont.SystemFontOfSize (16); TextView.TextAlignment = UITextAlignment.Natural; TextView.ContentMode = UIViewContentMode.Redraw; SendButton = new SendButton (); SendButton.SetImage (UIImage.FromBundle ("sendTextIcon"), UIControlState.Normal); SendButton.TranslatesAutoresizingMaskIntoConstraints = false; AddSubviews (TextView, SendButton); var c1 = NSLayoutConstraint.FromVisualFormat ("H:|-[input]-[button]-|", NSLayoutFormatOptions.DirectionLeadingToTrailing, "input", TextView, "button", SendButton ); // var c2 = NSLayoutConstraint.FromVisualFormat ("V:|-[input]-|", // NSLayoutFormatOptions.DirectionLeadingToTrailing, // "input", TextView // ); // AddConstraints (c2); var top = NSLayoutConstraint.Create(TextView, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1, 7); var bot = NSLayoutConstraint.Create(TextView, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, this, NSLayoutAttribute.Bottom, 1, -7); AddConstraint (top); AddConstraint (bot); // We want Send button was centered when Toolbar has MinHeight (pin button in this state) var c3 = NSLayoutConstraint.Create(SendButton, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.Bottom, 1, -ToolbarMinHeight / 2); AddConstraints (c1); AddConstraint (c3); }
public void ThenIShouldBeAbleToContactQAWorksWithTheFollowingInformation(Table table) { var form = table.CreateInstance <ContactUsForm>(); NameBox.SendKeys(form.Name); EmailBox.SendKeys(form.Email); MessageBox.SendKeys(form.Message); SendButton.SendKeys(Keys.Return); Assert.That(!NameValidation.Displayed, "Form not submitted due to Name validation"); Assert.That(!EmailValidation.Displayed, "Form not submitted due to invalid Email"); Assert.That(!EmailBoxValidation.Displayed, "Form not submitted due to Email validation"); Assert.That(!MessageValidation.Displayed, "Form not submitted due to Messsage validation"); Assert.That(NameBox.GetAttribute("value") == string.Empty, "Name field should be clear"); Assert.That(EmailBox.GetAttribute("value") == string.Empty, "Email field should be clear"); Assert.That(MessageBox.GetAttribute("value") == string.Empty, "Message box should be clear"); }
/// <summary> /// event listener for client textbox in chatlib or executor /// </summary> /// <param name="clientText"></param> private void Executor_ClientText(string clientText) { clientText = ClientInputTextBox.Text; stream = client.GetStream(); Byte[] data = System.Text.Encoding.ASCII.GetBytes(clientText); // Get a client stream for reading and writing. stream = client.GetStream(); // Send the message to the connected TcpServer. stream.Write(data, 0, data.Length); if (ClientServerOuputTextBox.InvokeRequired) { MethodInvoker invoker = new MethodInvoker(delegate() { //Executor.LoggingText(logFileName, " - Client: " + ClientInputTextBox.Text); chatLog.MakeLog(" - Client: " + ClientInputTextBox.Text); ClientServerOuputTextBox.AppendText("Client: " + ClientInputTextBox.Text + Executor.LineBreak()); ClientInputTextBox.Clear(); }); ClientServerOuputTextBox.Invoke(invoker); } else { //Executor.LoggingText(logFileName, " - Client: " + ClientInputTextBox.Text); chatLog.MakeLog(" - Client: " + ClientInputTextBox.Text); ClientServerOuputTextBox.AppendText("Client: " + ClientInputTextBox.Text + Executor.LineBreak()); ClientInputTextBox.Clear(); } //Responding to the end of the task. if (SendButton.Enabled == false) { if (SendButton.InvokeRequired) { MethodInvoker invoker = new MethodInvoker(delegate() { SendButton.Enabled = true; }); SendButton.Invoke(invoker); } else { SendButton.Enabled = true; } } }
// Start is called before the first frame update void Start() { HandField = GameObject.FindGameObjectWithTag("HandField").GetComponent <RectTransform>(); SelectedField = GameObject.FindGameObjectWithTag("SelectedField").GetComponent <RectTransform>(); netWorkManager = GameObject.FindGameObjectWithTag("NetWorkManager").GetComponent <NetWorkManager>(); OpponentHandField = GameObject.FindGameObjectWithTag("OpponentField").GetComponent <RectTransform>(); sendButton = GameObject.FindGameObjectWithTag("DeckButton").GetComponent <SendButton>(); OpponentName = GameObject.FindGameObjectWithTag("OpponentName").GetComponent <Text>(); // Resources/Imageフォルダ内にある画像を取得する imgList.Add(Resources.Load <Sprite>("Image/1")); imgList.Add(Resources.Load <Sprite>("Image/2")); imgList.Add(Resources.Load <Sprite>("Image/3")); for (int i = 0; i < imgList.Count; i++) { cardDataList.Add(new CardData(i, imgList[i])); } }
void LegitCombination() { sendButton = sendButtonG.GetComponent <SendButton>(); myList = sendButton.selectedCardsSent; Debug.Log(sendButton.selectedCardsSent); //selectedCards = GetComponent<SelectedCards>(); // myList = selectedCards.selectedCards; //myList.Sort(); for (int i = 0; cardCombinations.Count - 1 > i; i++) { cardCombinations[i].combination.Sort();//sort all combinations } for (int i = 0; i < cardCombinations.Count - 1; i++) { counter = 0; if (cardCombinations[i].combination.Count == myList.Count) { for (int b = 0; b < cardCombinations[i].combination.Count; b++) { if (cardCombinations[i].combination[b] == myList[b]) { counter++; } else { Debug.Log("Not a valid combination"); break; } } if (counter == myList.Count) { TotalScore += cardCombinations[i].score; Debug.Log(i); Debug.Log(TotalScore); break; } counter = 0; selectedCards.selectedCards.Clear(); } } }