Exemple #1
0
        static void Main(string[] args)
        {
            HandsetBrand phone = new HandsetBrandN();

            phone.SetHandsetSoft(new HandsetGame());
            phone.Run();

            phone.SetHandsetSoft(new HandsetAddressList());
            phone.Run();

            phone = new HandsetBrandM();

            phone.SetHandsetSoft(new HandsetGame());
            phone.Run();

            phone.SetHandsetSoft(new HandsetAddressList());
            phone.Run();

            Console.WriteLine("\n");

            Abstraction abstraction = new Abstraction();

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

            abstraction.SetImplementor(new ConcreteImplementorB());
            abstraction.Operation();

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Abstraction ab = new Abstraction();

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

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

            Console.Read();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Abstraction ab = new Abstraction();

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

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

            Console.Read();
        }