private void Message_Received_Event(ChatMessage message) { if(this.rtbChat.InvokeRequired) { this.rtbChat.Invoke(new ts_Message_Recieved_Event(this.Message_Received_Event), message); } else { this.rtbChat.AppendText(message.getName() + ": " + message.getMessage() + Environment.NewLine); } }
public void sendMessage(ChatMessage message) { bytes = new byte[1024]; data = null; bytes = Encoding.ASCII.GetBytes(message.getMessage()); stream.Write(bytes, 0, bytes.Length); if(Message_Sent != null) Message_Sent(message); }
private void Message_Sent_Event(ChatMessage message) { this.rtbChat.AppendText(message.getName() + ": " + message.getMessage() + Environment.NewLine); tbMessage.Text = placeholder; }
public void sendMessage(ChatMessage message) { this.writeStream(message.getMessage()); if(Message_Sent != null) Message_Sent(message); }
private void printMessage(ChatMessage message) { Console.WriteLine(message.getName() + " " + message.getMessage()); }
public void Message_Sent_Event(ChatMessage message) { printMessage(message); }
public void Message_Received_Event(ChatMessage message) { printMessage(message); }
public void Client_Disc_Event(ChatMessage message) { printMessage(message); }
public void Client_Conn_Event(ChatMessage message) { printMessage(message); }