예제 #1
0
        private void SendButton_Click(object sender, RoutedEventArgs e)
        {
            Server.SendMessageToAll(MessageTextBox.Text, UserNameTextBox.Text);
            string message = MessageTextBox.Text;
            string s1      = String.Empty;
            string s2      = String.Empty;

            bool check = true;

            for (int i = 0; i < message.Length; i++)
            {
                if (check == false)
                {
                    s2 = s2 + message[i];
                }

                if (check == true)
                {
                    if (message[i] != ':')
                    {
                        s1 = s1 + message[i];
                    }
                    else
                    {
                        check = false;
                    }
                }
            }
            TakeMessage(s1, "You");
            MessageTextBox.Text = "";
        }
예제 #2
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (MessageTextBox.Text.Length == 0)
     {
         return;
     }
     Server.SendMessageToAll(MessageTextBox.Text, userNameTextBox.Text);
     TakeMessage(MessageTextBox.Text, "you");
     MessageTextBox.Text = "";
 }
 //Sends the message in the chat textbox when send is clicked
 private void SendButton_Click(object sender, RoutedEventArgs e)
 {
     if (ChatTextBox.Text.Length == 0)
     {
         return;
     }
     Server.SendMessageToAll(ChatTextBox.Text, UserNameTextBox.Text);
     TakeMessage(ChatTextBox.Text, "You");
     ChatTextBox.Text = "";
 }
예제 #4
0
        //New command...
        private void SendButton_Click(object sender, RoutedEventArgs e)
        {
            //if message in message text box has no characters - dont allow send.
            if (MessageTextBox.Text.Length == 0)
            {
                return;
            }

            //This line of command tells the system to show username and message sent.
            Server.SendMessageToAll(MessageTextBox.Text, UserNameTextBox.Text);
            TakeMessage(MessageTextBox.Text, "You");
            MessageTextBox.Text = "";
        }
 private void btnSend_Click(object sender, RoutedEventArgs e)
 {
     Server.SendMessageToAll(txtsend.Text, txtUserName.Text);
     TakeMessage(txtsend.Text, txtUserName.Text);
     txtsend.Text = "";
 }
예제 #6
0
 private void SendButton_Click(object sender, RoutedEventArgs e)
 {
     Server.SendMessageToAll(messageTextbox.Text, userNameTextbox.Text);
     TakeMessage(messageTextbox.Text, "Me");
     messageTextbox.Text = "";
 }