/// <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); } }
public void OnCustomerRegistered(object source, CustomerEventArgs e) { Thread.Sleep(1000); Console.WriteLine("\n Receipt has been issued to {0}", e.CustomerName); }
public void OnRoomAssigned(object source, CustomerEventArgs d) { Thread.Sleep(2000); Console.WriteLine("\n Collect the car keys"); }