Beispiel #1
0
        public void Test()
        {
            var abstraction = new RefinedAbstraction();

            abstraction.Implementor = new ConcreteImplementorA();
            abstraction.Operation();

            abstraction.Implementor = new ConcreteImplementorB();
            abstraction.Operation();
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        public void Execute()
        {
            Abstraction ab = new RefinedAbstraction();

            // Set implementation and call
            ab.Implementor = new ConcreteImplementorA();
            ab.Operation();

            // Change implemention and call
            ab.Implementor = new ConcreteImplementorB();
            ab.Operation();
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        private static void Main()
        {
            Abstraction ab = new RefinedAbstraction();

            // Set implementation and call
            ab.Implementor = new ConcreteImplementorA();
            ab.Operation();

            // Change implemention and call
            ab.Implementor = new ConcreteImplementorB();
            ab.Operation();

            // Wait for user
            Console.ReadKey();
        }
Beispiel #4
0
        public void Run()
        {
            Abstraction abstraction = new RefinedAbstraction();

            // Set implementation and call
            abstraction.Implementor = new Implementor1();
            abstraction.Operation();

            // Change implemention and call
            abstraction.Implementor = new Implementor2();
            abstraction.Operation();

            // Wait for user
            Console.ReadKey();
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        private static void Main()
        {
            Abstraction ab = new RefinedAbstraction();

              // Set implementation and call
              ab.Implementor = new ConcreteImplementorA();
              ab.Operation();

              // Change implemention and call
              ab.Implementor = new ConcreteImplementorB();
              ab.Operation();

              // Wait for user
              Console.ReadKey();
        }