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);
        }
예제 #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);
 }
예제 #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));
        }
예제 #4
0
 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);
 }
예제 #5
0
 public T GetValueOrDefault <T>(AtomicStorePropertyDefinition propertyDefinition, T defaultValue)
 {
     return(this.parent.GetValueOrDefault <T>(propertyDefinition, defaultValue));
 }
예제 #6
0
 public T GetValueOrDefault <T>(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.GetValueOrDefault <T>(propertyDefinition, default(T)));
 }
예제 #7
0
 public object GetValue(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.parent.TryGetStoreProperty(propertyDefinition));
 }
예제 #8
0
 protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.changedProperties != null && this.changedProperties.Contains(propertyDefinition));
 }
예제 #9
0
 protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(false);
 }
예제 #10
0
 public bool IsDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.parent.InternalIsPropertyDirty(propertyDefinition));
 }
예제 #11
0
 protected abstract bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition);
예제 #12
0
 bool IDirectPropertyBag.IsDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(this.InternalIsPropertyDirty(propertyDefinition));
 }
예제 #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);
        }
예제 #14
0
 public T?GetValueAsNullable <T>(AtomicStorePropertyDefinition propertyDefinition) where T : struct
 {
     return(this.parent.GetValueAsNullable <T>(propertyDefinition));
 }
예제 #15
0
 public void SetValue(AtomicStorePropertyDefinition propertyDefinition, object propertyValue)
 {
     this.parent.SetValidatedStoreProperty(propertyDefinition, propertyValue);
 }
예제 #16
0
 public void Delete(AtomicStorePropertyDefinition propertyDefinition)
 {
     this.parent.DeleteStoreProperty(propertyDefinition);
 }
예제 #17
0
 public void SetOrDeleteProperty(AtomicStorePropertyDefinition propertyDefinition, object propertyValue)
 {
     this.parent.SetOrDeleteProperty(propertyDefinition, propertyValue);
 }
예제 #18
0
 protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition)
 {
     return(((IDirectPropertyBag)this.propertyBag).IsDirty(propertyDefinition));
 }
예제 #19
0
 public void SetValueWithFixup(AtomicStorePropertyDefinition propertyDefinition, object propertyValue)
 {
     this.parent.SetProperty(propertyDefinition, propertyValue);
 }
예제 #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();
 }