private MailBoxFolderStatus GetFolderStatus(string name) { if (!_mailFolderStatuses.ContainsKey(name)) { _mailFolderStatuses[name] = new MailBoxFolderStatus(); } return(_mailFolderStatuses[name]); }
private async Task <IList <UniqueId> > SearchMail(IMailFolder mailFolder, MailBoxFolderStatus folderStatus) { var tollerantSearch = new TolerantFunction <SearchQuery, IList <UniqueId> >(new TolerantFunctionConfig <SearchQuery, IList <UniqueId> >() { Func = searchQuery => mailFolder.Search(searchQuery) }); var query = SearchQuery.DeliveredAfter(folderStatus.LastChecked); return(await tollerantSearch.Execute(query)); }