protected virtual void OnRaiseNeedsFoodEvent(HungryEventArgs e) { EventHandler <HungryEventArgs> handler = NeedsFoodEvent; if (handler != null) { handler(this, e); } }
public void OnRaiseIsHungryEvent() { EventHandler <HungryEventArgs> handler = IsHungryEvent; if (handler != null) { var e = new HungryEventArgs { Message = _hungryMessage }; handler(this, e); } }