Пример #1
0
 static void Main()
 {
     var client = new Client {Strategy = new ConcreteStrategyA()};
     client.CallAlgorithm();
     client.Strategy = new ConcreteStrategyB();
     client.CallAlgorithm();
 }
Пример #2
0
        static void Main()
        {
            var client = new Client {
                Strategy = new ConcreteStrategyA()
            };

            client.CallAlgorithm();
            client.Strategy = new ConcreteStrategyB();
            client.CallAlgorithm();
        }
Пример #3
0
        static void Main(string[] args)
        {
            Client client = new Client();

            client.Strategy = new ConcreteStrategyA();
            client.CallAlgorithm();

            client.Strategy = new ConcreteStrategyB();
            client.CallAlgorithm();

            Console.ReadKey();
        }