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