/// <summary> /// New Data, the method to recieve data from the Custom Event Args /// </summary> /// <param name="Sender"></param> /// <param name="Data"></param> private void newData(Object Sender, MessageRecievingEventArgs Data) { if (txtConversation.InvokeRequired) { txtConversation.Invoke(new MethodInvoker(delegate () { //Append Text to box txtConversation.Text += "\r\n" + "Server: " + Data.RealMessage; })); }//end if else { //Append Text to box txtConversation.Text += "\n" + "Server: " + Data; }//end else }//end newData
/// <summary> /// New Data, the method to recieve data from the Custom Event Args /// </summary> /// <param name="Sender"></param> /// <param name="Data"></param> private void newData(Object Sender, MessageRecievingEventArgs Data) { if (txtConversation.InvokeRequired) { txtConversation.Invoke(new MethodInvoker(delegate () { //Append Text to box txtConversation.Text += "\r\n" + "Server: " + Data.RealMessage; //Create line with timestamp, and add message Line = DateTime.Now.ToString("YYYY-MM-dd-HH:MM:SS") + " Server: " + Data.RealMessage + "\r\n"; //Write to log logger.WriteFile(File, Line); })); }//end if else { //Append Text to box txtConversation.Text += "\n" + "Server: " + Data; //Create line with timestamp, and add message Line = DateTime.Now.ToString("yyyy-MM-dd-HH:mm:ss") + " Server: " + Data + "\n"; //Write to log logger.WriteFile(File, Line); }//end else }//end newData