Exemplo n.º 1
0
        private IListenerService _listenerService;                  // A listener that receives messages.

        public DataHandler(IListenerService listenerService, IClientService clientService)
        {
            _clientService   = clientService;
            _listenerService = listenerService;

            _listenerService.StartListener(ReceivedInformation);
        } // End of Constructor
Exemplo n.º 2
0
        private IListenerService _listenerService;                      // A listener that receives messages.

        public DataHandler(IListenerService listenerService, IClientService clientService)
        {
            _clientService   = clientService;
            _listenerService = listenerService;

            _listenerService.StartListener(UpdateOutputTextBoxesDuringEvents);

            _timer.Interval = TimeSpan.FromMilliseconds(5000); // Set the period of the events.
            _timer.Tick    += sendData;                        // Attach handler

            _timer.Start();
        } // End of Constructor