public BikeCustomer(IBikeShop shop, string name) { _shop = shop; _name = name; _shop.NewBikeArrivedEvent += HandleNewBikeEvents; }
public WeakReference <IBikeShop> RegisterShop(IBikeShop bikeShop) { WeakReference <IBikeShop> shop = new WeakReference <IBikeShop>(bikeShop); _shops.Add(shop); // We want to return the weak refernce shop so we can use it to unregister later return(shop); }