If I have an event whose handler returns bool, what happens if I attach multiple events?
see this example
public class MyClass
{
public delegate bool MyEventHandler(object sender, EventArgs e);
public event MyEventHandler Submit;
public void DoSubmissions()
{
if (Submit != null && Submit(this, null))
{
Console.Write("HOORAY");
}
}
}
therefore, in my example, the handler returns true on success. but I assign two event handlers ... what happens? is the first handler used? second? neither? as?
source
share