protected virtual void OnRaiseEvent(RentedItemEvent e)
 {
     EventHandler<RentedItemEvent> handler = RaiseCustomEvent;
     if (handler != null)
     {
         e.Message += "Book rented";
         handler(this, e);
     }
     else
     {
         Console.WriteLine("There are no listeners.");
     }
 }
Beispiel #2
0
        protected virtual void OnRaiseEvent(RentedItemEvent e)
        {
            EventHandler <RentedItemEvent> handler = RaiseCustomEvent;

            if (handler != null)
            {
                e.Message += "Book rented";
                handler(this, e);
            }
            else
            {
                Console.WriteLine("There are no listeners.");
            }
        }
Beispiel #3
0
 void HandleEvent(object sender, RentedItemEvent e)
 {
     MessageBox.Show("Book has been rented");
 }
 void HandleEvent(object sender, RentedItemEvent e)
 {
     MessageBox.Show("Book has been rented");
 }