예제 #1
0
        internal static void FillDisplayNames(List <MessageTrackingSearchResult> results, IRecipientSession recipSession)
        {
            BulkRecipientLookupCache bulkRecipientLookupCache = new BulkRecipientLookupCache(100);

            foreach (MessageTrackingSearchResult messageTrackingSearchResult in results)
            {
                IEnumerable <string> addresses = from address in messageTrackingSearchResult.RecipientAddresses
                                                 select address.ToString();

                messageTrackingSearchResult.RecipientDisplayNames = bulkRecipientLookupCache.Resolve(addresses, recipSession).ToArray <string>();
            }
        }
예제 #2
0
        private void FillDisplayNames(BulkRecipientLookupCache recipientNamesCache, IRecipientSession galSession)
        {
            string text = this.internalMessageTrackingReport.FromAddress.ToString();

            SmtpAddress[]        recipientAddresses = this.internalMessageTrackingReport.RecipientAddresses;
            IEnumerable <string> addresses          = (from address in recipientAddresses
                                                       select address.ToString()).Concat(new string[]
            {
                text
            });
            IEnumerable <string> source = recipientNamesCache.Resolve(addresses, galSession);

            this[MessageTrackingSharedResultSchema.RecipientDisplayNames] = source.Take(recipientAddresses.Length).ToArray <string>();
            this[MessageTrackingSharedResultSchema.FromDisplayName]       = source.Last <string>();
        }
        internal static void FillDisplayNames(BulkRecipientLookupCache recipientCache, RecipientTrackingEvent[] recipientEvents, IRecipientSession session)
        {
            if (recipientEvents == null || recipientEvents.Length == 0)
            {
                return;
            }
            IEnumerable <string> addresses = from recipientEvent in recipientEvents
                                             select recipientEvent.RecipientAddress.ToString();

            IEnumerable <string> enumerable = recipientCache.Resolve(addresses, session);
            int num = 0;

            foreach (string recipientDisplayName in enumerable)
            {
                recipientEvents[num].RecipientDisplayName = recipientDisplayName;
                num++;
            }
        }