//A function to make the next function take the standard notification method is nothing else is specified public int SetSale(Vehicle v, Seller s) { return SetSale(v, s, s.RecieveNotification); }
//A function to set a car for sale public int SetSale(Vehicle v, Seller s, Action<Vehicle, decimal> notificationMethod) { int AuctionNumber = v.RegNumber.GetHashCode(); ForSale.Add(AuctionNumber, v); v.VehicleSeller = s; v.notify = notificationMethod; return AuctionNumber; }
//METHODS public void RecieveNotification(Vehicle v, decimal bid) { Console.WriteLine("\nAn interesting bid has been placed on:\n{0}\nThe bid is: {1:C}", v, bid); }