Пример #1
0
        public static Dictionary <string, RecipientEventData> DeserializeMultiple(List <RecipientTrackingEvent> combinedReports)
        {
            Dictionary <string, List <RecipientTrackingEvent> > dictionary = new Dictionary <string, List <RecipientTrackingEvent> >();

            foreach (RecipientTrackingEvent recipientTrackingEvent in combinedReports)
            {
                string key = recipientTrackingEvent.ExtendedProperties.MessageTrackingReportId ?? string.Empty;
                List <RecipientTrackingEvent> list;
                if (!dictionary.TryGetValue(key, out list))
                {
                    list            = new List <RecipientTrackingEvent>();
                    dictionary[key] = list;
                }
                list.Add(recipientTrackingEvent);
            }
            Dictionary <string, RecipientEventData> dictionary2 = new Dictionary <string, RecipientEventData>(dictionary.Count);

            foreach (string key2 in dictionary.Keys)
            {
                dictionary2[key2] = RecipientEventData.Deserialize(dictionary[key2]);
            }
            return(dictionary2);
        }
 public MessageTrackingReport(MessageTrackingReportId identity, DateTime submittedDateTime, string subject, SmtpAddress?fromAddress, string fromDisplayName, SmtpAddress[] recipientAddresses, string[] recipientDisplayNames, RecipientEventData eventData)
 {
     if (recipientAddresses == null)
     {
         throw new ArgumentNullException("recipientAddresses", "Param cannot be null, pass in empty SmtpAddress[] instead");
     }
     if (recipientDisplayNames == null)
     {
         throw new ArgumentNullException("recipientDisplayNames", "Param cannot be null, pass in empty string[] instead");
     }
     this.identity              = identity;
     this.submittedDateTime     = submittedDateTime;
     this.subject               = subject;
     this.fromAddress           = fromAddress;
     this.fromDisplayName       = fromDisplayName;
     this.recipientAddresses    = recipientAddresses;
     this.recipientDisplayNames = recipientDisplayNames;
     this.eventData             = eventData;
 }