Пример #1
0
 /// <summary>
 /// This event will notify all the subscribers
 /// </summary>
 protected virtual void OnCustomerRegistered(string name)
 {
     //This will check if there is any subscriber
     if (CustomerRegistered != null)
     {
         //The source is the class and we are returning nothing
         CustomerEventArgs dt = new CustomerEventArgs();
         dt.CustomerName = name;
         CustomerRegistered(this, dt);
     }
 }
Пример #2
0
 public void OnCustomerRegistered(object source, CustomerEventArgs e)
 {
     Thread.Sleep(1000);
     Console.WriteLine("\n Receipt has been issued to {0}", e.CustomerName);
 }
Пример #3
0
 public void OnRoomAssigned(object source, CustomerEventArgs d)
 {
     Thread.Sleep(2000);
     Console.WriteLine("\n Collect the car keys");
 }