Пример #1
0
 /// <summary>
 /// <b>Defensively</b> invokes the supplied <paramref name="sink"/>, passing the
 /// supplied <paramref name="arguments"/> to the sink.
 /// </summary>
 /// <param name="sink">The sink to be invoked.</param>
 /// <param name="arguments">The arguments to the sink.</param>
 /// <param name="exceptions">the map of sink/exception entries to add any exception to</param>
 protected override void Invoke(Delegate sink, object[] arguments, EventExceptionsCollector exceptions)
 {
     try
     {
         sink.DynamicInvoke(arguments);
     }
     catch (Exception ex)
     {
         Log.Warn("Error during raising an event from " + new StackTrace(), ex);
         exceptions.Add(sink, ex);
     }
 }
Пример #2
0
 /// <summary>
 /// <b>Defensively</b> invokes the supplied <paramref name="sink"/>, passing the
 /// supplied <paramref name="arguments"/> to the sink.
 /// </summary>
 /// <param name="sink">The sink to be invoked.</param>
 /// <param name="arguments">The arguments to the sink.</param>
 /// <param name="exceptions">the map of sink/exception entries to add any exception to</param>
 protected override void Invoke(Delegate sink, object[] arguments, EventExceptionsCollector exceptions)
 {
     try
     {
         sink.DynamicInvoke (arguments);
     }
     catch(Exception ex)
     {
         Log.Warn("Error during raising an event from " + new StackTrace(), ex);
         exceptions.Add(sink, ex);
     }
 }
Пример #3
0
 /// <summary>
 /// Invokes the supplied <paramref name="sink"/>, passing the supplied
 /// <paramref name="arguments"/> to the sink.
 /// </summary>
 /// <param name="sink">The sink to be invoked.</param>
 /// <param name="arguments">The arguments to the sink.</param>
 /// <param name="exceptions">the map of sink/exception entries to add any exception to</param>
 protected virtual void Invoke(Delegate sink, object[] arguments, EventExceptionsCollector exceptions)
 {
     try
     {
         sink.DynamicInvoke(arguments);
     }
     catch (TargetInvocationException ex)
     {
         // unwrap the exception that actually caused the TargetInvocationException and throw that...
         Exception cause = ReflectionUtils.UnwrapTargetInvocationException(ex);
         exceptions.Add(sink, cause);
         throw cause;
     }
 }
Пример #4
0
 /// <summary>
 /// Invokes the supplied <paramref name="sink"/>, passing the supplied
 /// <paramref name="arguments"/> to the sink.
 /// </summary>
 /// <param name="sink">The sink to be invoked.</param>
 /// <param name="arguments">The arguments to the sink.</param>
 /// <param name="exceptions">the map of sink/exception entries to add any exception to</param>
 protected virtual void Invoke(Delegate sink, object[] arguments, EventExceptionsCollector exceptions) 
 {
     try 
     {
         sink.DynamicInvoke (arguments);
     } 
     catch (TargetInvocationException ex) 
     {
         // unwrap the exception that actually caused the TargetInvocationException and throw that...
         Exception cause = ReflectionUtils.UnwrapTargetInvocationException(ex);
         exceptions.Add(sink, cause);
         throw cause;
     }
 }