예제 #1
0
        public static void SpringEventSafely <T1>(IAgileLogger agileLogger, string eventPath, Delegate theEvent, T1 t1)
        {
            if (theEvent == null)
            {
                return;
            }

            foreach (var invocation in theEvent.GetInvocationList())
            {
                try
                {
                    var cb = (Action <T1>)invocation;
                    cb(t1);
                }
                catch (Exception ee)
                {
                    while (ee.InnerException != null)
                    {
                        ee = ee.InnerException;
                    }
                    agileLogger.Log(ee,
                                    string.Format("{0} On handle event [{1}].", ReflectionUtil.GetMethodFullName(invocation.Method),
                                                  eventPath), ErrorLevel.Standard);
                }
            }
        }
예제 #2
0
 public static void SpringEventSafely(IAgileLogger agileLogger, string eventPath, Delegate theEvent)
 {
     if (theEvent != null)
     {
         foreach (Delegate delegate2 in theEvent.GetInvocationList())
         {
             try
             {
                 CbGeneric generic = (CbGeneric)delegate2;
                 generic();
             }
             catch (Exception innerException)
             {
                 while (innerException.InnerException != null)
                 {
                     innerException = innerException.InnerException;
                 }
                 agileLogger.Log(innerException, string.Format("{0} On handle event [{1}].", ReflectionHelper.GetMethodFullName(delegate2.Method), eventPath), ErrorLevel.Standard);
             }
         }
     }
 }
예제 #3
0
        public static void SpringEventSafely(IAgileLogger agileLogger, string eventPath, Delegate theEvent)
        {
            if (theEvent == null)
            {
                return;
            }

            foreach (Delegate invocation in theEvent.GetInvocationList())
            {
                try
                {
                    CbGeneric cb = (CbGeneric)invocation;
                    cb();
                }
                catch (Exception ee)
                {
                    while (ee.InnerException != null)
                    {
                        ee = ee.InnerException;
                    }
                    agileLogger.Log(ee, string.Format("{0} On handle event [{1}].", ReflectionHelper.GetMethodFullName(invocation.Method), eventPath), ErrorLevel.Standard);
                }
            }
        }
예제 #4
0
 void IAgileLogger.Log(Exception ex, string location, ErrorLevel level)
 {
     logger.Log(ex, location, level);
     datalogger.Log(ex, location, level);
 }