//allow methods to subscribe to the pricecut event //the Action parameter allows methods that return void to be passed in to this function. //the <int, int> parameters for the Action specify the supplier ID and the price, respectively. public void subscribeToPriceCut(Action <int, int> travelAgencyEventListener) { //now the address of the Action (function) passed to this method will //be called when the priceHasBeenCut event is triggered priceHasBeenCut += new PriceCutEvent(travelAgencyEventListener); }
//allow methods to subscribe to the pricecut event //the Action parameter allows methods that return void to be passed in to this function. //the <int, int> parameters for the Action specify the supplier ID and the price, respectively. public void subscribeToPriceCut(Action<int, int> travelAgencyEventListener) { //now the address of the Action (function) passed to this method will //be called when the priceHasBeenCut event is triggered priceHasBeenCut += new PriceCutEvent(travelAgencyEventListener); }