fix for SPRNET-1260. DefensiveEventRaiser now rethrows first caught exception, if any

This commit is contained in:
eeichinger
2009-11-16 13:26:19 +00:00
parent 94a4c7c79d
commit 38c513b6e8

View File

@@ -87,19 +87,16 @@ namespace Spring.Util
/// <returns>a map of sink/exception entries that occurred during event raising</returns>
public virtual IEventExceptionsCollector Raise(Delegate source, params object[] arguments)
{
if (source == null)
{
return null;
}
EventExceptionsCollector exceptions = new EventExceptionsCollector();
Delegate [] delegates = source.GetInvocationList ();
foreach (Delegate sink in delegates)
if (source != null)
{
Invoke (sink, arguments, exceptions);
Delegate [] delegates = source.GetInvocationList ();
foreach (Delegate sink in delegates)
{
Invoke (sink, arguments, exceptions);
}
}
return exceptions;
}