public DoorStateService(Func <DoorContext> doorContextFactory, Func <IDoorEvent> doorEventFactory, IMessageReaderService messageReaderService) { _createDoorContext = doorContextFactory; _createEvent = doorEventFactory; messageReaderService.DoorControlMessageReceived += OnControlMessageReceived; messageReaderService.Listen(); }
public MessageViewerViewModel(IMessageReaderService messageReaderService, IDoorInformationMessageFactory informationMessageFactory) { _informationMessageFactory = informationMessageFactory; messageReaderService.DoorControlMessageReceived += OnControlMessageReceived; messageReaderService.DoorInformationMessageReceived += OnInformationMessageReceived; messageReaderService.Listen(); }
public DoorsViewModel(IMessageReaderService messageReaderService, IMessageWriterService messageWriterService, IDoorViewCreationService doorViewCreationService) { _uiThread = Thread.CurrentThread; _messageWriterService = messageWriterService; _doorViewCreationService = doorViewCreationService; messageReaderService.SetTheRoutingKey(RoutingKeys.DoorInformationRoutingKey); messageReaderService.DoorInformationMessageReceived += OnInformationMessageReceived; messageReaderService.Listen(); }
public void SetDoorModel(IDoor door) { Updating(); DoorId = $"{door.Id}"; DoorLabel = door.Label; State = door.State; FinishedUpdating(); var routingKey = $"{RoutingKeys.SpecificDoorRoutingKey}{door.Id}"; _messageWriterService.SetTheRoutingKey(routingKey); _messageReaderService.SetTheRoutingKey(routingKey); _messageReaderService.DoorControlMessageReceived += OnControlMessageReceived; _messageReaderService.Listen(); }