Exemplo n.º 1
0
        private void WriteRecipient(ConversionRecipientEntry recipient)
        {
            if (recipient.Participant == null)
            {
                return;
            }
            RecipientItemType recipientItemType = recipient.RecipientItemType;

            if (!ConvertUtils.IsRecipientTransmittable(recipientItemType) && this.tnefType != TnefType.SummaryTnef)
            {
                return;
            }
            this.tnefWriter.StartRow();
            this.tnefWriter.WriteProperty(TnefPropertyTag.RecipientType, (int)MapiUtil.RecipientItemTypeToMapiRecipientType(recipientItemType, false));
            Participant participant = recipient.Participant;

            this.tnefWriter.WriteProperty(TnefPropertyTag.DisplayNameW, participant.DisplayName ?? string.Empty);
            this.tnefWriter.WriteProperty(TnefPropertyTag.EmailAddressW, participant.EmailAddress ?? string.Empty);
            this.tnefWriter.WriteProperty(TnefPropertyTag.AddrtypeW, participant.RoutingType ?? string.Empty);
            foreach (NativeStorePropertyDefinition nativeStorePropertyDefinition in recipient.AllNativeProperties)
            {
                if (nativeStorePropertyDefinition != null && nativeStorePropertyDefinition != InternalSchema.RecipientType && nativeStorePropertyDefinition != InternalSchema.DisplayName && nativeStorePropertyDefinition != InternalSchema.EmailAddress && nativeStorePropertyDefinition != InternalSchema.AddrType && this.propertyChecker.IsRecipientPropertyWritable(nativeStorePropertyDefinition))
                {
                    this.WriteRecipientProperty(recipient, nativeStorePropertyDefinition);
                }
            }
        }
 internal void AddRecipients(List <Participant> participants, RecipientItemType recipientType)
 {
     foreach (Participant participant in participants)
     {
         ConversionRecipientEntry recipientEntry = new ConversionRecipientEntry(participant, recipientType);
         this.AddRecipient(recipientEntry);
     }
 }
        private void WriteRecipientProperty(ConversionRecipientEntry recipient, NativeStorePropertyDefinition property)
        {
            object obj = recipient.TryGetProperty(property);

            if (!PropertyError.IsPropertyError(obj))
            {
                this.WriteProperty(property, obj);
            }
        }
Exemplo n.º 4
0
        private bool WriteRecipientProperty(ConversionRecipientEntry recipient, NativeStorePropertyDefinition property)
        {
            object obj = recipient.TryGetProperty(property);

            if (!PropertyError.IsPropertyError(obj))
            {
                obj = ExTimeZoneHelperForMigrationOnly.ToLegacyUtcIfDateTime(obj);
                this.tnefWriter.WriteProperty(property, obj);
                return(true);
            }
            return(false);
        }
Exemplo n.º 5
0
        private void CopyRecipientToMessage(ICoreItem coreItem, ConversionRecipientEntry entry)
        {
            CoreRecipient coreRecipient = coreItem.Recipients.CreateCoreRecipient(new CoreRecipient.SetDefaultPropertiesDelegate(Recipient.SetDefaultRecipientProperties), entry.Participant);

            coreRecipient.RecipientItemType = entry.RecipientItemType;
            foreach (NativeStorePropertyDefinition nativeStorePropertyDefinition in entry.AllNativeProperties)
            {
                object obj = entry.TryGetProperty(nativeStorePropertyDefinition);
                coreRecipient.PropertyBag.TryGetProperty(nativeStorePropertyDefinition);
                if (!(obj is PropertyError) && !RecipientBase.ImmutableProperties.Contains(nativeStorePropertyDefinition))
                {
                    coreRecipient.PropertyBag.SetProperty(nativeStorePropertyDefinition, obj);
                }
            }
            coreRecipient.InternalUpdateParticipant(entry.Participant);
        }
Exemplo n.º 6
0
 internal void CopyDataToItem(ICoreItem coreItem, bool importResourceFromTnef)
 {
     base.ReplyTo.Resync(true);
     foreach (ConversionItemParticipants.ParticipantDefinitionEntry participantDefinitionEntry in ConversionItemParticipants.ParticipantEntries)
     {
         CoreObject.GetPersistablePropertyBag(coreItem).SetOrDeleteProperty(participantDefinitionEntry.ParticipantProperty, this.propertyBag.TryGetProperty(participantDefinitionEntry.ParticipantProperty));
     }
     CoreObject.GetPersistablePropertyBag(coreItem).SetOrDeleteProperty(InternalSchema.MapiReplyToBlob, this.propertyBag.TryGetProperty(InternalSchema.MapiReplyToBlob));
     CoreObject.GetPersistablePropertyBag(coreItem).SetOrDeleteProperty(InternalSchema.MapiReplyToNames, this.propertyBag.TryGetProperty(InternalSchema.MapiReplyToNames));
     if (this.tnefRecipientList != null)
     {
         Dictionary <ConversionRecipientEntry, ConversionRecipientEntry> dictionary = new Dictionary <ConversionRecipientEntry, ConversionRecipientEntry>();
         foreach (ConversionRecipientEntry conversionRecipientEntry in this.tnefRecipientList)
         {
             dictionary[conversionRecipientEntry] = conversionRecipientEntry;
         }
         foreach (ConversionRecipientEntry conversionRecipientEntry2 in this.recipients)
         {
             ConversionRecipientEntry conversionRecipientEntry3 = null;
             if (dictionary.TryGetValue(conversionRecipientEntry2, out conversionRecipientEntry3) && conversionRecipientEntry3 != null)
             {
                 conversionRecipientEntry2.CopyDependentProperties(conversionRecipientEntry3);
             }
         }
     }
     foreach (ConversionRecipientEntry conversionRecipientEntry4 in this.recipients)
     {
         if (RecipientItemType.Bcc == conversionRecipientEntry4.RecipientItemType)
         {
             importResourceFromTnef = false;
         }
         this.CopyRecipientToMessage(coreItem, conversionRecipientEntry4);
     }
     if (importResourceFromTnef)
     {
         foreach (ConversionRecipientEntry conversionRecipientEntry5 in this.tnefRecipientList)
         {
             if (RecipientItemType.Bcc == conversionRecipientEntry5.RecipientItemType && (conversionRecipientEntry5.Participant.GetValueOrDefault <bool>(ParticipantSchema.IsRoom, false) || conversionRecipientEntry5.Participant.GetValueOrDefault <bool>(ParticipantSchema.IsResource, false)))
             {
                 this.CopyRecipientToMessage(coreItem, conversionRecipientEntry5);
             }
         }
     }
 }
        private void WriteRecipient(ConversionRecipientEntry recipient, int recipientIndex)
        {
            if (recipient.Participant == null)
            {
                return;
            }
            this.PropertyWriter.StartRecipient();
            this.writer.WriteProperty(TnefPropertyTag.Rowid, recipientIndex);
            RecipientItemType recipientItemType = recipient.RecipientItemType;

            this.writer.WriteProperty(TnefPropertyTag.RecipientType, (int)MapiUtil.RecipientItemTypeToMapiRecipientType(recipientItemType, false));
            foreach (NativeStorePropertyDefinition nativeStorePropertyDefinition in recipient.AllNativeProperties)
            {
                if (nativeStorePropertyDefinition != null && !OutboundMsgConverter.recipientExcludedPropertySet.Contains(nativeStorePropertyDefinition))
                {
                    this.WriteRecipientProperty(recipient, nativeStorePropertyDefinition);
                }
            }
        }
Exemplo n.º 8
0
 internal void CopyDependentProperties(ConversionRecipientEntry dependentEntry)
 {
     if (dependentEntry == null)
     {
         return;
     }
     foreach (NativeStorePropertyDefinition property in dependentEntry.AllNativeProperties)
     {
         object obj = dependentEntry.TryGetProperty(property);
         if (obj != null && !(obj is PropertyError))
         {
             this.SetProperty(property, obj, false);
         }
     }
     foreach (PropertyDefinition propertyDefinition in dependentEntry.propertyValues.DeleteList)
     {
         StorePropertyDefinition property2 = (StorePropertyDefinition)propertyDefinition;
         this.DeleteProperty(property2, false);
     }
 }
Exemplo n.º 9
0
        private void CopyAttendeeData(Item item)
        {
            CalendarItemBase calendarItemBase = item as CalendarItemBase;

            if (calendarItemBase != null)
            {
                foreach (Attendee attendee in calendarItemBase.AttendeeCollection)
                {
                    ConversionRecipientEntry conversionRecipientEntry = new ConversionRecipientEntry(attendee.Participant, (RecipientItemType)attendee.AttendeeType);
                    foreach (PropertyDefinition propertyDefinition in attendee.CoreRecipient.PropertyBag.AllFoundProperties)
                    {
                        StorePropertyDefinition property = (StorePropertyDefinition)propertyDefinition;
                        object obj = attendee.TryGetProperty(property);
                        if (!(obj is PropertyError))
                        {
                            conversionRecipientEntry.SetProperty(property, obj, false);
                        }
                    }
                    base.AddRecipient(conversionRecipientEntry);
                }
            }
        }
Exemplo n.º 10
0
        private void CopyRecipientData(Item item)
        {
            RecipientCollection     recipientCollection  = null;
            CoreRecipientCollection recipientCollection2 = item.CoreItem.GetRecipientCollection(true);

            if (recipientCollection2 != null)
            {
                recipientCollection = new RecipientCollection(recipientCollection2);
            }
            foreach (Recipient recipient in recipientCollection)
            {
                ConversionRecipientEntry conversionRecipientEntry = new ConversionRecipientEntry(recipient.Participant, recipient.RecipientItemType);
                foreach (PropertyDefinition propertyDefinition in recipient.CoreRecipient.PropertyBag.AllFoundProperties)
                {
                    StorePropertyDefinition property = (StorePropertyDefinition)propertyDefinition;
                    object obj = recipient.TryGetProperty(property);
                    if (!(obj is PropertyError))
                    {
                        conversionRecipientEntry.SetProperty(property, obj, false);
                    }
                }
                base.AddRecipient(conversionRecipientEntry);
            }
        }
Exemplo n.º 11
0
        public override bool Equals(object obj)
        {
            ConversionRecipientEntry conversionRecipientEntry = obj as ConversionRecipientEntry;

            return(conversionRecipientEntry != null && (object.ReferenceEquals(this.Participant, conversionRecipientEntry.Participant) || (this.Participant != null && this.RecipientItemType == conversionRecipientEntry.RecipientItemType && this.Participant.AreAddressesEqual(conversionRecipientEntry.Participant))));
        }
 internal void AddRecipient(ConversionRecipientEntry recipientEntry)
 {
     this.limitsTracker.CountRecipient();
     this.recipients.Add(recipientEntry);
 }