Exemple #1
0
        private static void Example3()
        {
            var pult = new Pult();
            var tv   = new TvSet();

            pult.SetCommand(new TvSetCommand(tv));
            pult.PressButton();
            pult.PressUndo();

            var microwave = new Microwave();

            pult.SetCommand(new MicrowaveCommand(microwave, 5000));                 // 5000 - время нагрева пищи
            pult.PressButton();
        }
Exemple #2
0
        private static void Example2()
        {
            var pult  = new Pult();
            var tvSet = new TvSet();

            pult.SetCommand(new TvSetCommand(tvSet));
            pult.PressButton();
            pult.PressUndo();
        }