Example #1
0
        private void Initialize()
        {
            // We are starting up for the first time.
            _modeState = new ModePowerUpState(this);

            _door = new Door(this);

            // The initial configuration setting for the
            // device. This initial configuration can come
            // from an external configuration file, for
            // example.
            _configurationState = new ProductionConfigurationState(this);

            // The door is initially closed
            _door.DoorState = new DoorClosedState(_door);

            // We are ready
            _modeState.SetModeToIdle();
        }
Example #2
0
 public ModeBusyState(ModeState modeState)
 {
     Initialize();
     this.Device = modeState.Device;
 }
 public ModePowerDownState(ModeState modeState)
 {
     Initialize();
     this.Device = modeState.Device;
 }