From e5e7b74f45c6f968b8442df9dfaae93a6aafe5ab Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Thu, 23 Jul 2009 23:57:55 +0000 Subject: [PATCH] Allow text printer to work from different threads... patch by nephrael git-svn-id: https://radegast.googlecode.com/svn/trunk@121 f7a694da-4d33-11de-9ad6-1127a62b9fcd --- Radegast/Core/RichTextBoxPrinter.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Radegast/Core/RichTextBoxPrinter.cs b/Radegast/Core/RichTextBoxPrinter.cs index 97122be..8496f34 100644 --- a/Radegast/Core/RichTextBoxPrinter.cs +++ b/Radegast/Core/RichTextBoxPrinter.cs @@ -47,12 +47,17 @@ namespace Radegast public void PrintText(string text) { + if (rtb.InvokeRequired) + { + rtb.Invoke(new MethodInvoker(() => rtb.AppendText(text))); + return; + } rtb.AppendText(text); } public void PrintTextLine(string text) { - rtb.AppendText(text + Environment.NewLine); + PrintText(text + Environment.NewLine); } public void PrintTextLine(string text, Color color) -- 2.11.0