private InvoiceDownloader( ImapService serviceConfig, Credentials credentials, string folder, AttachmentProcessor attachmentProcessor) { imapService = new SimpleImapService(serviceConfig, credentials); sourceFolderName = folder; mailFolderFinder = new MailFolderFinder( client => folderName => client .GetFolder(client.PersonalNamespaces[0]) .GetSubfolders(false) .Where(subFolder => subFolder.Name.ToUpper().Equals(folderName.ToUpper())), imapService.client ); this.attachmentProcessor = attachmentProcessor; }
TimesheetProcessor( ImapService serviceConfig, Credentials credentials, string sourceFolder, string processedFolder, string attentionFolder, AttachmentProcessor attachmentProcessor) { imapService = new SimpleImapService(serviceConfig, credentials); sourceFolderName = sourceFolder; processedFolderName = processedFolder; attentionFolderName = attentionFolder; mailFolderFinder = new MailFolderFinder( client => folderName => { var folders = new List <IMailFolder>(); folders.Add(client.GetFolder(folderName)); return(folders); }, imapService.client ); this.attachmentProcessor = attachmentProcessor; }