public virtual void OnFoodReady(FoodReadyEventArgs e) { EventHandler <FoodReadyEventArgs> handler = FoodReady; if (handler != null) { handler(this, e); } }
void HandleCustomEvent(object sender, FoodReadyEventArgs e) { Eat(e.thisFood); }