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); } }
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; } } }
protected virtual void OnScopeException(ScopeExceptionEventArg e) { EventHandler<ScopeExceptionEventArg> handler = ScopeException; if (handler != null) handler(this, e); }