示例#1
0
 protected override void OnScopeException(ScopeExceptionEventArg e)
 {
     base.OnScopeException(e);
     if (!string.IsNullOrEmpty(Message))
     {
         Console.WriteLine(">LOG --- Exception caught: {0}, Type: {1}  ---", Message, e.Exception.GetType().Name);
     }
 }
示例#2
0
 protected virtual void Call()
 {
     if (code != null)
     {
         try
         {
             code(null);
         }
         catch (Exception ex)
         {
             ScopeExceptionEventArg e = new ScopeExceptionEventArg { Exception = ex };
             OnScopeException(e);
             if (!e.Handled)
                 throw ex;
         }
         finally
         {
             code = null;
         }
     }
 }
示例#3
0
 protected virtual void OnScopeException(ScopeExceptionEventArg e)
 {
     EventHandler<ScopeExceptionEventArg> handler = ScopeException;
     if (handler != null)
         handler(this, e);
 }