コード例 #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;
     }
 }