Example #1
0
        static void Main(string[] args)
        {
            FuelPrices priceManager = new FuelPrices();

            Station fredericia = new Station(priceManager, Region.Jylland, "Fredericia");
            Station odense     = new Station(priceManager, Region.Fyn, "Odense");
            Station kbh        = new Station(priceManager, Region.Sjælland, "København");
            Station tinge      = new Station(priceManager, Region.Jylland, "Tinge");

            priceManager.Attach(fredericia);
            priceManager.Attach(odense);
            priceManager.Attach(kbh);
            priceManager.Attach(tinge);

            priceManager.KeroOxy = 10;
            Console.WriteLine("________________________________________________________________________________________");
            fredericia.OnSale    = true;
            priceManager.KeroOxy = 10;
            Console.WriteLine("________________________________________________________________________________________");
            fredericia.OnSale    = false;
            priceManager.KeroOxy = 20;

            Console.ReadKey(false);
        }
Example #2
0
 public Station(FuelPrices prices, Region region, string city)
 {
     this.region = region;
     this.Prices = prices;
     this.City   = city;
 }