Ejemplo n.º 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>();
            }
        }
Ejemplo n.º 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++;
            }
        }
Ejemplo n.º 4
0
        internal static MessageTrackingReport Create(IConfigurationSession configurationSession, IRecipientSession recipientSession, MultiValuedProperty <CultureInfo> userLanguages, bool summaryEvents, bool returnHelpDeskMessages, bool trackingAsSender, MessageTrackingReport internalMessageTrackingReport, bool doNotResolve, bool isCompleteReport)
        {
            RecipientTrackingEvent[] recipientTrackingEvents = internalMessageTrackingReport.RecipientTrackingEvents;
            if (!doNotResolve && recipientTrackingEvents.Length > 256)
            {
                ExTraceGlobals.TaskTracer.TraceDebug <int, int>(0L, "Recipient events ({0}) are more than MaxDisplaynameLookupsAllowed ({1}), turning off display-names", recipientTrackingEvents.Length, 256);
                doNotResolve = true;
            }
            RecipientTrackingEvent[] array;
            if (summaryEvents)
            {
                array = MessageTrackingReport.GetRecipientEventsForSummaryReport(configurationSession, recipientSession, userLanguages, returnHelpDeskMessages, trackingAsSender, recipientTrackingEvents);
            }
            else
            {
                array = MessageTrackingReport.GetRecipientEventsForRecipientPathReport(configurationSession, recipientSession, userLanguages, returnHelpDeskMessages, trackingAsSender, recipientTrackingEvents, isCompleteReport);
            }
            if (array == null)
            {
                return(null);
            }
            int capacity = summaryEvents ? array.Length : 1;
            BulkRecipientLookupCache bulkRecipientLookupCache = new BulkRecipientLookupCache(capacity);

            if (!doNotResolve)
            {
                RecipientTrackingEvent.FillDisplayNames(bulkRecipientLookupCache, array, recipientSession);
            }
            MessageTrackingReport messageTrackingReport = new MessageTrackingReport(internalMessageTrackingReport, array);

            if (summaryEvents)
            {
                messageTrackingReport.FillDisplayNames(bulkRecipientLookupCache, recipientSession);
            }
            messageTrackingReport.PrepareRecipientTrackingEvents(returnHelpDeskMessages, summaryEvents);
            return(messageTrackingReport);
        }