Пример #1
0
 public void addMessage(string time, string text)
 {
     if (this.MessagesRichTextBox.InvokeRequired)
     {
         setThreadedAddMessageCallback statusLabelCallback = new setThreadedAddMessageCallback(this.addMessage);
         this.obj.Invoke(statusLabelCallback, time, text);
     }
     else
     {
         this.allMessages += this.nick + " " + time + "\n" + text + " \n\n\n";
         this.MessagesRichTextBox.Text = this.allMessages;
         //this.MessagesRichTextBox.SelectionStart = this.MessagesRichTextBox.TextLength;
         this.MessagesRichTextBox.ScrollToCaret();
         this.user.saveMessages(this.allMessages);
     }
 }
Пример #2
0
 public void addMessage(string time, string text)
 {
     if (this.MessagesRichTextBox.InvokeRequired)
     {
         setThreadedAddMessageCallback statusLabelCallback = new setThreadedAddMessageCallback(this.addMessage);
         this.obj.Invoke(statusLabelCallback, time, text);
     }
     else
     {
         this.allMessages += this.nick + " " + time + "\n" + text + " \n\n\n";
         this.MessagesRichTextBox.Text = this.allMessages;
         //this.MessagesRichTextBox.SelectionStart = this.MessagesRichTextBox.TextLength;
         this.MessagesRichTextBox.ScrollToCaret();
         this.user.saveMessages(this.allMessages);
     }
 }