Example #1
0
        public void Start(Settings config)
        {
            Console.WriteLine("Monitoring starting...");

            _tasks = new Task[config.Mailboxes.Count];

            for (var i = 0; i < config.Mailboxes.Count; i++)
            {
                Thread.Sleep(config.Iteration.Delay);

                var mailbox = config.Mailboxes[i];

                _tasks[i] = Task.Run(() => OnProcess(mailbox, _cancellationSource.Token), _cancellationSource.Token);
            }
        }
Example #2
0
 public EmailService(ISettingsReader settingsReader)
 {
     _config = settingsReader.Read();
 }
Example #3
0
 public NotificationService(IUnitOfWork unitOfWork, ISettingsReader settingsReader, IEmailService emailService)
 {
     _unitOfWork = unitOfWork;
     _emailService = emailService;
     _config = settingsReader.Read();
 }