Ejemplo n.º 1
0
        /// <summary>
        /// Retrieves emails based on search criteria
        /// </summary>
        /// <param name="searchCriteria"></param>
        private void RetrieveEmails(EmailSearchCriteria searchCriteria)
        {
            // perform search
            var newEmails    = _emailManager.Search(searchCriteria);
            var newEmailList = newEmails as IList <IEmail> ?? newEmails.ToList();

            // set polling time
            using (var repository = _marketDataRepositoryFactory.CreateRepository())
                _lastPolled = repository.UpdateEmailFeedLastPolled(_emailFeedConfiguration.ID);

            // if any new emails were found, raise event
            if (newEmailList.Count > 0)
            {
                RaiseNewEmailsFound(newEmailList);
            }
        }