Yes. What I mean is to fire the event on the UI thread. Sorry that I am
not too familar with the multithreading library in C#. Would you mind
giving me more illustration on "cycle through the delegate chain"?
Cheyrl,
When you make a call to fire an event, you usually do something like
this:
eventHandler(this, new EventArgs());
Or something similar, where eventHandler is the event declaration for
your event (of course, you check for null as well).
Instead of that, you would do this:
foreach (EventHandler handler in eventHandler.GetInvocationList())
{
// Check for the ISynchronizeInvoke implementation.
ISynchronizeInvoke si = handler.Target as ISynchronizeInvoke;
// If there is an implementation, call it on that thread.
if (si != null)
{
// Call.
si.Invoke(handler, new object[2]{this, new EventArgs()});
}
else
{
// Call normally.
handler(this, new EventArgs);
}
}

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Yes. What I mean is to fire the event on the UI thread. Sorry that I am
> not too familar with the multithreading library in C#. Would you mind
[quoted text clipped - 13 lines]
>>> invoke the main thread before updating the control. Would this be
>>> possible? If yes, how should I do so?