Exemplo n.º 1
0
        public NotifierProcessorDecorator(ANotifierProcessorParams notifierProcessorParams) : base(notifierProcessorParams.NotifierProcessor)
        {
            if (CheckTimeForCloseApp(((NotifierProcessorDecoratorParams)notifierProcessorParams).Lifetime))
            {
                return;
            }
            _dataReader     = ((NotifierProcessorDecoratorParams)notifierProcessorParams).DataReader;
            _clientsManager = notifierProcessorParams.ClientsManager;
            _logger         = notifierProcessorParams.Logger;

            if (((NotifierProcessorDecoratorParams)notifierProcessorParams).Lifetime != DateTime.MinValue)
            {
                _lifetime = ((NotifierProcessorDecoratorParams)notifierProcessorParams).Lifetime;
                _timer    = new Timer(notifierProcessorParams.Interval)
                {
                    AutoReset = true
                };
                _timer.Elapsed += (sender, eventArgs) =>
                {
                    Close();
                };

                _timer.Start();
            }

            Execute();
        }
Exemplo n.º 2
0
 protected ANotificationDataReaderDecorator(INotificationDataReader notificationDataReader) => NotificationDataReader = notificationDataReader;
Exemplo n.º 3
0
 public NotificationDataReaderDecorator(INotificationDataReader notificationDataReader, int id) : base(notificationDataReader)
 {
     _id = id;
 }