public void AddBefore(BeforeAction <T> action) { if (before.Exists(a => a.IsSame(action))) { throw EventHandlerAlreadyExistsException.CreateFromKey(action.Name); } before.Add(action); }
public void AddAfter(AfterAction <T> action) { if (after.Exists(a => a.IsSame(action))) { throw EventHandlerAlreadyExistsException.CreateFromKey(action.Name); } after.Add(action); }