Esempio n. 1
0
 public static CoffeeServiceLocator GetInstance()
 {
     if (locator == null)
     {
         locator = new CoffeeServiceLocator();
     }
     return(locator);
 }
Esempio n. 2
0
            public static Coffee PrepareCoffee()
            {
                var    coffeeMachine = CoffeeServiceLocator.GetInstance().GetCoffeeMachine();
                Coffee coffee        = coffeeMachine.BrewFilterCoffee();

                Console.WriteLine("Coffee is ready!");
                return(coffee);
            }