Ejemplo n.º 1
0
 private void MethodName()
 {
     while (clientCode.Connected)
     {
         CommunicationFile result = clientCode.RecieveMessage();
         if (result.Language != "ERROR")
         {
             Invoke(new MethodInvoker(delegate() { richTextBox1.AppendText((result.WriteTime + ", " + result.Language + ": " + result.Author + ": " + result.Message + Environment.NewLine + Environment.NewLine)); }));
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// send button, sends the text to server
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button1_Click(object sender, EventArgs e)
        {
            CommunicationFile newMessage = new CommunicationFile(language, DateTime.Now, author, textBox1.Text + Environment.NewLine);

            clientCode.SendMessage(newMessage.ConvertToByteArray());
        }