예제 #1
0
    static void Main()
    {
        Abstraction ab = new RefinedAbstraction();

        ab.SetImplementor(new ConcreteImplementorA());
        ab.Operation();
        ab.SetImplementor(new ConcreteImplementorB());
        ab.Operation();
        Console.ReadKey();
    }
예제 #2
0
        static void Main(string[] args)
        {
            Abstraction ab = new RefinedAbstraction();

            ab.SetImplementor(new ConcreteImplementorA());
            ab.Operation();

            ab.SetImplementor(new ConcreteImplementorB());
            ab.Operation();
        }
예제 #3
0
        public static void BridgePattern()
        {
            Abstraction ab = new RefinedAbstraction();

            ab.SetImplementor(new ConcreteImplementorA());
            ab.Operation();
            ab.SetImplementor(new ConcreteImplementorB());
            ab.Operation();

            Console.Read();
        }
예제 #4
0
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Abstraction ab = new RefinedAbstraction();

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

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

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