Hello,
I have been searching stackoverflow for ways to marshal data back from a thread to the UI thread, and have found various ways to do it in 3.5.
One of the more elegant solutions to me; although I am still learning lambdas and closures is this solution http://stackoverflow.com/questions/783925/control-invoke-with-input-parameters.
I don't completely understand the code, but I do understand how to use it and it doesn't quite solve my problem.
I would like to call invoke and pass a string to another method (DisplayStatusUpdate(msg)). Any pointers would be appreciated.
private void FireEventAppender_OnMessageLogged(object sender, MessageLoggedEventArgs e)
{
DisplayStatusUpdate(e.LoggingEvent.RenderedMessage);
}
private void DisplayStatusUpdate(string text)
{
_StatusTextBox.Text = _StatusTextBox.Text + text;
_StatusTextBox.Text = String.Format("{0}\r\n", _StatusTextBox.Text);
_StatusTextBox.SelectionStart = _StatusTextBox.Text.Length - 1;
_StatusTextBox.ScrollToCaret();
}