Esempio n. 1
0
 public DoorOpenedNotificationHandler(
     AccessPointState state,
     ILEDService ledService,
     IBuzzerService buzzerService,
     IServiceEventClient serviceEventClient,
     ILogger <DoorOpenedNotificationHandler> logger)
 {
     _state              = state;
     _ledService         = ledService;
     _buzzerService      = buzzerService;
     _serviceEventClient = serviceEventClient;
     _logger             = logger;
 }
 public DoorClosedNotificationHandler(
     IMediator mediator,
     AccessPointState state,
     ILEDService ledService,
     IRelayControlService relayControlService,
     IServiceEventClient serviceEventClient,
     ILogger <DoorClosedNotificationHandler> logger)
 {
     _mediator            = mediator;
     _state               = state;
     _ledService          = ledService;
     _relayControlService = relayControlService;
     _serviceEventClient  = serviceEventClient;
     _logger              = logger;
 }
Esempio n. 3
0
 public LockCommandHandler(
     IMediator mediator,
     AccessPointState state,
     IRelayControlService relayControlService,
     IServiceEventClient serviceEventClient,
     ILEDService ledService,
     ILogger <LockCommandHandler> logger)
 {
     _mediator            = mediator;
     _state               = state;
     _relayControlService = relayControlService;
     _serviceEventClient  = serviceEventClient;
     _ledService          = ledService;
     _logger              = logger;
 }
 public SetConfigurationCommandHandler(
     IMediator mediator,
     AccessPointState state,
     AccessPointContext accessPointContext,
     IRelayControlService relayControlService,
     IServiceEventClient serviceEventClient,
     ILEDService ledService)
 {
     _mediator           = mediator;
     _accessPointContext = accessPointContext;
     _state = state;
     _relayControlService = relayControlService;
     _serviceEventClient  = serviceEventClient;
     _ledService          = ledService;
 }
        public AccessPointService(
            IServiceProvider ServiceProvider,
            IMediator mediator,
            IButtonService buttonService,
            ISwitchService switchService,
            IRfidReader rfidReader,
            IRelayControlService relayControlService,
            IPirSensorService pirSensorService,
            AccessPointState state,
            ICommandReceiver commandReceiver,
            IServiceEventClient serviceEventClient)
        {
            _serviceProvider     = ServiceProvider;
            _mediator            = mediator;
            _buttonService       = buttonService;
            _switchService       = switchService;
            _rfidReader          = rfidReader;
            _relayControlService = relayControlService;
            _pirSensorService    = pirSensorService;
            _state           = state;
            _commandReceiver = commandReceiver;

            WhenButtonPressedOpened = Observable.FromEventPattern(
                handler => _buttonService.Pressed += handler,
                handler => _buttonService.Pressed -= handler);

            WhenButtonReleasedClosed = Observable.FromEventPattern(
                handler => _buttonService.Released += handler,
                handler => _buttonService.Released -= handler);

            WhenSwitchOpened = Observable.FromEventPattern(
                handler => _switchService.Opened += handler,
                handler => _switchService.Opened -= handler);

            WhenSwitchClosed = Observable.FromEventPattern(
                handler => _switchService.Closed += handler,
                handler => _switchService.Closed -= handler);

            WhenMotionDetected = Observable.FromEventPattern(
                handler => _pirSensorService.MotionDetected += handler,
                handler => _pirSensorService.MotionDetected -= handler);

            WhenMotionNotDetected = Observable.FromEventPattern(
                handler => _pirSensorService.MotionNotDetected += handler,
                handler => _pirSensorService.MotionNotDetected -= handler);
        }