예제 #1
0
        static void Main(string[] args)
        {
            //create a simple coffee machine
            var simpleCoffeeMachine = new SimpleCoffeeMachine();

            //brew coffee
            simpleCoffeeMachine.BrewCoffee();

            var premiumCoffeeMachine = new PremiumCoffeeMachine();

            //create an adapter for premium coffee
            var adapter = new PremiumCoffeeMachineAdapter(premiumCoffeeMachine, CoffeeKind.Expresso);

            //brew coffee
            adapter.BrewCoffee();
        }
예제 #2
0
 public PremiumCoffeeMachineAdapter(PremiumCoffeeMachine coffeeMachine, CoffeeKind coffeeKind)
 {
     this.coffeeMachine = coffeeMachine;
     this.coffeeKind    = coffeeKind;
 }