M
mehdi_mousavi
Hi folks,
Consider the following code:
MyClass c = new MyClass();
c.MyEvent += new MyEventHandler(MyHandler);
where MyClass is defined as follows:
public class MyClass
{
public delegate void MyEventHandler(object sender, EventArgs e);
public event MyEventHandler MyEvent = null;
//Other things go here...
}
and MyHandler is defined this way:
private void MyHandler(object sender, EventArgs e) {}
The question is that what context the "MyHandler" method is executed
on? Is it executed under the same thread where the Event Handler is
called? or does it use the "thread pool" to execute the handler on
another thread?
Any help would be highly appreciated,
Cheers,
Mehdi
Consider the following code:
MyClass c = new MyClass();
c.MyEvent += new MyEventHandler(MyHandler);
where MyClass is defined as follows:
public class MyClass
{
public delegate void MyEventHandler(object sender, EventArgs e);
public event MyEventHandler MyEvent = null;
//Other things go here...
}
and MyHandler is defined this way:
private void MyHandler(object sender, EventArgs e) {}
The question is that what context the "MyHandler" method is executed
on? Is it executed under the same thread where the Event Handler is
called? or does it use the "thread pool" to execute the handler on
another thread?
Any help would be highly appreciated,
Cheers,
Mehdi