protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value)
        {
            Participant        participant        = (Participant)value;
            ParticipantEntryId participantEntryId = ParticipantEntryId.FromParticipant(participant, ParticipantEntryIdConsumer.ContactEmailSlot);

            propertyBag.SetValueWithFixup(base.DisplayNamePropertyDefinition, participant.DisplayName ?? string.Empty);
            propertyBag.SetValueWithFixup(base.EmailAddressPropertyDefinition, participant.EmailAddress ?? string.Empty);
            propertyBag.SetValueWithFixup(base.RoutingTypePropertyDefinition, participant.RoutingType ?? string.Empty);
            if (this.emailAddressForDisplayPropDef != null)
            {
                AtomicStorePropertyDefinition propertyDefinition = this.emailAddressForDisplayPropDef;
                string propertyValue;
                if ((propertyValue = participant.GetValueOrDefault <string>(ParticipantSchema.EmailAddressForDisplay)) == null)
                {
                    propertyValue = (participant.EmailAddress ?? string.Empty);
                }
                propertyBag.SetValueWithFixup(propertyDefinition, propertyValue);
            }
            if (participantEntryId != null)
            {
                propertyBag.SetValueWithFixup(base.EntryIdPropertyDefinition, participantEntryId.ToByteArray());
                return;
            }
            propertyBag.Delete(base.EntryIdPropertyDefinition);
        }
Example #2
0
 public void Update(AtomicStorePropertyDefinition propertyDefinition, object propertyValue)
 {
     if (propertyValue == null || PropertyError.IsPropertyNotFound(propertyValue))
     {
         this.parent.DeleteStoreProperty(propertyDefinition);
         return;
     }
     this.parent.SetProperty(propertyDefinition, propertyValue);
 }
Example #3
0
        protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value)
        {
            base.InternalSetValue(propertyBag, value);
            Participant        participant        = (Participant)value;
            ParticipantEntryId participantEntryId = ParticipantEntryId.FromParticipant(participant, ParticipantEntryIdConsumer.RecipientTablePrimary);

            if (participantEntryId != null)
            {
                propertyBag.SetValueWithFixup(InternalSchema.EntryId, participantEntryId.ToByteArray());
            }
            else
            {
                propertyBag.Delete(InternalSchema.EntryId);
            }
            RecipientDisplayType?      valueAsNullable  = participant.GetValueAsNullable <RecipientDisplayType>(ParticipantSchema.DisplayTypeEx);
            LegacyRecipientDisplayType?valueAsNullable2 = participant.GetValueAsNullable <LegacyRecipientDisplayType>(ParticipantSchema.DisplayType);

            if (participant.RoutingType != null)
            {
                propertyBag.Update(InternalSchema.TransmitableDisplayName, participant.DisplayName);
                if (valueAsNullable2 == null)
                {
                    valueAsNullable2 = new LegacyRecipientDisplayType?(LegacyRecipientDisplayType.MailUser);
                }
            }
            else
            {
                propertyBag.Delete(InternalSchema.TransmitableDisplayName);
            }
            AtomicStorePropertyDefinition displayTypeExInternal = InternalSchema.DisplayTypeExInternal;
            RecipientDisplayType?         recipientDisplayType  = valueAsNullable;

            propertyBag.Update(displayTypeExInternal, (recipientDisplayType != null) ? new int?((int)recipientDisplayType.GetValueOrDefault()) : null);
            AtomicStorePropertyDefinition displayType = InternalSchema.DisplayType;
            LegacyRecipientDisplayType?   legacyRecipientDisplayType = valueAsNullable2;

            propertyBag.Update(displayType, (legacyRecipientDisplayType != null) ? new int?((int)legacyRecipientDisplayType.GetValueOrDefault()) : null);
            if (valueAsNullable2 != null)
            {
                if (valueAsNullable2 == LegacyRecipientDisplayType.DistributionList || valueAsNullable2 == LegacyRecipientDisplayType.PersonalDistributionList)
                {
                    propertyBag.SetValueWithFixup(InternalSchema.ObjectType, 8);
                }
                else
                {
                    propertyBag.SetValueWithFixup(InternalSchema.ObjectType, 6);
                }
            }
            else
            {
                propertyBag.Delete(InternalSchema.ObjectType);
            }
            propertyBag.SetValueWithFixup(InternalSchema.SendRichInfo, participant.GetValueOrDefault <bool>(ParticipantSchema.SendRichInfo));
            propertyBag.Update(InternalSchema.SendInternetEncoding, participant.GetValueAsNullable <int>(ParticipantSchema.SendInternetEncoding));
        }
 internal ParticipantList(PropertyBag propertyBag, AtomicStorePropertyDefinition participantsBlobStorePropertyDefinition, AtomicStorePropertyDefinition participantsNamesStorePropertyDefinition, AtomicStorePropertyDefinition participantCountStorePropertyDefinition, bool suppressCorruptDataException = false)
 {
     if (participantsBlobStorePropertyDefinition == null)
     {
         throw new ArgumentNullException("participantsBlobStorePropertyDefinition");
     }
     this.participantsBlobStorePropertyDefinition  = participantsBlobStorePropertyDefinition;
     this.participantsNamesStorePropertyDefinition = participantsNamesStorePropertyDefinition;
     this.participantsCountStorePropertyDefinition = participantCountStorePropertyDefinition;
     this.propertyBag = propertyBag;
     this.Resync(suppressCorruptDataException);
 }
Example #5
0
 public T GetValueOrDefault <T>(AtomicStorePropertyDefinition propertyDefinition, T defaultValue)
 {
     return(this.parent.GetValueOrDefault <T>(propertyDefinition, defaultValue));
 }
Example #6
0
 public T GetValueOrDefault <T>(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.GetValueOrDefault <T>(propertyDefinition, default(T)));
 }
Example #7
0
 public object GetValue(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.parent.TryGetStoreProperty(propertyDefinition));
 }
 protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.changedProperties != null && this.changedProperties.Contains(propertyDefinition));
 }
Example #9
0
 protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(false);
 }
Example #10
0
 public bool IsDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.parent.InternalIsPropertyDirty(propertyDefinition));
 }
Example #11
0
 protected abstract bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition);
Example #12
0
 bool IDirectPropertyBag.IsDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.InternalIsPropertyDirty(propertyDefinition));
 }
Example #13
0
        private static T ExceptionHandlingGetValueOrDefault <T>(PropertyBag.BasicPropertyStore propertyBag, AtomicStorePropertyDefinition propertyDefinition, T defaultValue)
        {
            T result;

            try
            {
                result = propertyBag.GetValueOrDefault <T>(propertyDefinition, defaultValue);
            }
            catch (NotInBagPropertyErrorException)
            {
                result = defaultValue;
            }
            return(result);
        }
Example #14
0
 public T?GetValueAsNullable <T>(AtomicStorePropertyDefinition propertyDefinition) where T : struct
 {
     return(this.parent.GetValueAsNullable <T>(propertyDefinition));
 }
Example #15
0
 public void SetValue(AtomicStorePropertyDefinition propertyDefinition, object propertyValue)
 {
     this.parent.SetValidatedStoreProperty(propertyDefinition, propertyValue);
 }
Example #16
0
 public void Delete(AtomicStorePropertyDefinition propertyDefinition)
 {
     this.parent.DeleteStoreProperty(propertyDefinition);
 }
Example #17
0
 public void SetOrDeleteProperty(AtomicStorePropertyDefinition propertyDefinition, object propertyValue)
 {
     this.parent.SetOrDeleteProperty(propertyDefinition, propertyValue);
 }
 protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(((IDirectPropertyBag)this.propertyBag).IsDirty(propertyDefinition));
 }
Example #19
0
 public void SetValueWithFixup(AtomicStorePropertyDefinition propertyDefinition, object propertyValue)
 {
     this.parent.SetProperty(propertyDefinition, propertyValue);
 }
Example #20
0
 protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     base.CheckDisposed("InternalIsPropertyDirty");
     return(((IDirectPropertyBag)this.memoryPropertyBag).IsDirty(propertyDefinition));
 }
 protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     throw new NotSupportedException();
 }