protected void BeforeInvoke(MethodInfo method, object[] args) { var handlers = GetHandlers(method, EAOPStatus.Before); if (handlers == null) { return; } foreach (var handler in handlers) { var aea = new AOPEventArgs { Method = method, Status = EAOPStatus.Before, Args = args, Result = null, Error = null }; handler.OnInvoke(this, aea); } }
protected void OnError(MethodInfo method, object[] args, Exception e) { var handlers = GetHandlers(method, EAOPStatus.Error); if (handlers == null) { return; } foreach (var handler in handlers) { var aea = new AOPEventArgs { Method = method, Status = EAOPStatus.Error, Args = args, Result = null, Error = e }; handler.OnInvoke(this, aea); } }