Пример #1
0
        static void Main(string[] args)
        {
            ModeSwitch modeSwitch = new ModeSwitch();

            modeSwitch.OnSwitch();
            modeSwitch.OnSwitch();
            modeSwitch.OnSwitch();
            modeSwitch.OnSwitch();
        }
Пример #2
0
 public void Toggle(ModeSwitch modeSwitch)
 {
     Console.WriteLine("FROM DARK TO LIGTH");
     modeSwitch.SetState(new ModeStateLight());
 }
Пример #3
0
 public void Toggle(ModeSwitch modeSwitch)
 {
     Console.WriteLine("FROM LIGHT TO DARK");
     modeSwitch.SetState(new ModeStateDark());
 }