Example #1
0
        public override void Disable()
        {
            Console.WriteLine("Начинаем выключаться...");
            ShowState();

            _nextState = new LoadingState();
            Computer.SetState(_nextState);
            _nextState.Disable();
        }
Example #2
0
        public override void Enable()
        {
            Console.WriteLine("Начинаем запуск...");
            ShowState();

            _nextState = new LoadingState();
            Computer.SetState(_nextState);
            _nextState.Enable();
        }
Example #3
0
        public override void Disable()
        {
            Console.WriteLine("Выключаемся...");
            ShowState();
            Task.Delay(1000).Wait();

            _nextState = new StartState();
            Computer.SetState(_nextState);
            _nextState.Disable();
        }
Example #4
0
        public override void Enable()
        {
            Console.WriteLine("Загружаемся...");
            ShowState();
            Task.Delay(2000).Wait();

            _nextState = new LoadedState();
            Computer.SetState(_nextState);
            _nextState.Enable();
        }
Example #5
0
 public void SetState(AbstractBootState state)
 {
     State = state;
     State.SetComputer(this);
 }
Example #6
0
 public Computer()
 {
     State = new StartState();
     State.SetComputer(this);
 }