I tried in the vb group, but no answer. Maybe c# folks can help.
The controls and forms allow you to call their .Invoke method, which
allows you to switch back and process whatever you are processing on the
UI thread.
I'd like to implement .Invoke for my own objects for this type of
scenario below. Is it possible?
|
public class XXX
{
private YYY ObjectThatRunsOnDifferentThread = new YYY();
private delegate void myDelegate(string s);
//handles an event from ||ObjectThatRunsOnDifferentThread object|
| private void SomeEventHandler()
{
this.Invoke(new myDelegate(new ||myDelegate||(ProcessData)), new
object[] {"Data"});
}
private void ProcessData(string s)
{
}
}
|