コード例 #1
0
        private void SendButton_Click(object sender, RoutedEventArgs e)
        {
            var messageToSend = ToSendTextBox.Text;

            ToSendTextBox.Text = string.Empty;
            ToSendTextBox.Focus();

            if (messageToSend.StartsWith("?"))
            {
                _commandService.ExecuteCommand(messageToSend);
                return;
            }

            PrintUserLine(Nickname, messageToSend);

            var convertedMessage = InformationConverter.Serialize(new Information(Nickname, messageToSend));

            _client.SendMessage(convertedMessage);
        }
コード例 #2
0
 private void ChangeTitle()
 {
     Title += $" - {Nickname}";
     ToSendTextBox.Focus();
 }