public void FireBeforeFavourite(object sender, FavouriteEventArgs eventArgs) { var handler = BeforeFavourite; if (handler != null) { handler(this, eventArgs); } }
public Favourite Add(Favourite favourite) { var e = new FavouriteEventArgs { Favourite = favourite }; EventManager.Instance.FireBeforeFavourite(this, e); if (!e.Cancel) { favourite = _favouriteRepository.Add(favourite); EventManager.Instance.FireAfterFavourite(this, new FavouriteEventArgs { Favourite = favourite}); } return favourite; }
public void FireBeforeFavourite(object sender, FavouriteEventArgs eventArgs) { var handler = BeforeFavourite; if (handler != null) { handler(this, eventArgs); } }