Operation() public method

public Operation ( ) : void
return void
Example #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();
        }
Example #2
0
        static void Main(string[] args)
        {
            Abstraction ab = new Abstraction();

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

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

            Console.Read();
        }
Example #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();
        }
Example #4
0
        private static void Main()
        {
            Abstraction abstraction = new Abstraction(new ConcreteImplementorA());

            abstraction.Operation();
            abstraction = new Abstraction(new ConcreteImplementorB());
            abstraction.Operation();
            Console.ReadLine();
        }
Example #5
0
 public void ClientCode(Abstraction abstraction)
 {
     Console.WriteLine(abstraction.Operation());
 }