private void HandleDoorChangedEvent(object sender, DoorStateChangedEventArgs e)
        {
            if (e.StateOpen == true && _doorLockState == false)               //Når en person åbner skabet
            {
                _state        = LadeskabState.DoorOpen;
                _stationState = (int)_state;

                _doorOpenState = e.StateOpen;
                _consoleWriter.DoorOpened();
            }

            if (e.StateOpen == false && _doorLockState == false)              // Når en person lukker skabet
            {
                _state        = LadeskabState.Available;
                _stationState = (int)_state;

                _doorOpenState = e.StateOpen;
                _consoleWriter.DoorClosed();
            }
        }
Example #2
0
 public virtual void OnDoorStateChanged(DoorStateChangedEventArgs e)
 {
     DoorChangedEvent?.Invoke(this, e);
 }