I saw such code somewhere.
Ideally, I would like this loop to fit this type of Func event.
public static event Func<RecentDirectories, DirectoryInfo, Exception, bool> ContinueOnExceptionEvent;
protected virtual bool TryContinueOnException(DirectoryInfo dir, Exception ex)
{
if (!Aborted)
{
if (null != ContinueOnExceptionEvent)
{
foreach (var e in ContinueOnExceptionEvent)
{
if (e(this, dir, ex))
{
return true;
}
}
}
}
return false;
}
How do I get foreach to get all events and repeat them?
source
share