コード例 #1
0
        private MailBoxFolderStatus GetFolderStatus(string name)
        {
            if (!_mailFolderStatuses.ContainsKey(name))
            {
                _mailFolderStatuses[name] = new MailBoxFolderStatus();
            }


            return(_mailFolderStatuses[name]);
        }
コード例 #2
0
        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));
        }