Beispiel #1
0
        public ImapMailBox(IClientConfiguration config, IMailBoxLogger mbLogger, IImapWorker imapWorker, IImapIdler imapIdler, IEmailSender emailSender)
        {
            _config = config;
            _mbLogger = mbLogger;
            _imapWorker = imapWorker;
            _imapIdler = imapIdler;
            _emailSender = emailSender;

            MailBoxName = _config.MailBoxName;
            MailBoxId = _config.Id;
        }
Beispiel #2
0
        public void Dispose()
        {
            Trace.WriteLine($"{MailBoxName} Dispose Called");

            _imapIdler.MessageArrived -= ImapIdlerOnMessageArrived;
            _imapIdler.MessageExpunged -= ImapIdlerOnMessageExpunged;
            _imapIdler.MessageSeen -= ImapIdlerOnMessageSeen;
            _emailSender.ExceptionHappened -= EmailSenderOnExceptionHappened;
            _imapIdler.IntegrityCheck -= ImapIdlerOnIntegrityCheck;

            NewMessageReceived = null;
            MessageRemoved = null;

            _imapWorker = null;
            _imapIdler = null;
            _emailSender = null;
            _emailFilterer = null;
            _mbLogger = null;
            _config = null;
            logger = null;
        }