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); }
public void Update(AtomicStorePropertyDefinition propertyDefinition, object propertyValue) { if (propertyValue == null || PropertyError.IsPropertyNotFound(propertyValue)) { this.parent.DeleteStoreProperty(propertyDefinition); return; } this.parent.SetProperty(propertyDefinition, propertyValue); }
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); }
public T GetValueOrDefault <T>(AtomicStorePropertyDefinition propertyDefinition, T defaultValue) { return(this.parent.GetValueOrDefault <T>(propertyDefinition, defaultValue)); }
public T GetValueOrDefault <T>(AtomicStorePropertyDefinition propertyDefinition) { return(this.GetValueOrDefault <T>(propertyDefinition, default(T))); }
public object GetValue(AtomicStorePropertyDefinition propertyDefinition) { return(this.parent.TryGetStoreProperty(propertyDefinition)); }
protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition) { return(this.changedProperties != null && this.changedProperties.Contains(propertyDefinition)); }
protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition) { return(false); }
public bool IsDirty(AtomicStorePropertyDefinition propertyDefinition) { return(this.parent.InternalIsPropertyDirty(propertyDefinition)); }
protected abstract bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition);
bool IDirectPropertyBag.IsDirty(AtomicStorePropertyDefinition propertyDefinition) { return(this.InternalIsPropertyDirty(propertyDefinition)); }
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); }
public T?GetValueAsNullable <T>(AtomicStorePropertyDefinition propertyDefinition) where T : struct { return(this.parent.GetValueAsNullable <T>(propertyDefinition)); }
public void SetValue(AtomicStorePropertyDefinition propertyDefinition, object propertyValue) { this.parent.SetValidatedStoreProperty(propertyDefinition, propertyValue); }
public void Delete(AtomicStorePropertyDefinition propertyDefinition) { this.parent.DeleteStoreProperty(propertyDefinition); }
public void SetOrDeleteProperty(AtomicStorePropertyDefinition propertyDefinition, object propertyValue) { this.parent.SetOrDeleteProperty(propertyDefinition, propertyValue); }
protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition) { return(((IDirectPropertyBag)this.propertyBag).IsDirty(propertyDefinition)); }
public void SetValueWithFixup(AtomicStorePropertyDefinition propertyDefinition, object propertyValue) { this.parent.SetProperty(propertyDefinition, propertyValue); }
protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition) { base.CheckDisposed("InternalIsPropertyDirty"); return(((IDirectPropertyBag)this.memoryPropertyBag).IsDirty(propertyDefinition)); }
protected override bool InternalIsPropertyDirty(AtomicStorePropertyDefinition propertyDefinition) { throw new NotSupportedException(); }