protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value) { Participant participant = (Participant)value; ParticipantEntryId participantEntryId = ParticipantEntryId.FromParticipant(participant, this.entryIdConsumer); propertyBag.Update(this.displayNamePropDef, participant.DisplayName); propertyBag.Update(this.emailAddressPropDef, participant.EmailAddress); propertyBag.Update(this.routingTypePropDef, participant.RoutingType); propertyBag.Update(this.entryIdPropDef, (participantEntryId != null) ? participantEntryId.ToByteArray() : null); if (this.smtpAddressPropDef != null) { propertyBag.Update(this.smtpAddressPropDef, participant.TryGetProperty(ParticipantSchema.SmtpAddress)); } if (this.sipUriPropDef != null) { propertyBag.Update(this.sipUriPropDef, participant.TryGetProperty(ParticipantSchema.SipUri)); } if (this.sidPropDef != null) { propertyBag.Update(this.sidPropDef, participant.TryGetProperty(ParticipantSchema.ParticipantSID)); } if (this.guidPropDef != null) { propertyBag.Update(this.guidPropDef, participant.TryGetProperty(ParticipantSchema.ParticipantGuid)); } }
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); }
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)); }
private void AddPermissionEntriesForAddOrModify(MapiAclTableAdapter mapiAclTableAdapter) { foreach (Permission permission in this.permissions.Values) { byte[] array = null; if (permission.Origin == PermissionOrigin.New) { if (permission.Principal.Type == PermissionSecurityPrincipal.SecurityPrincipalType.ADRecipientPrincipal) { ParticipantEntryId participantEntryId = ParticipantEntryId.FromParticipant(new Participant(permission.Principal.ADRecipient), ParticipantEntryIdConsumer.SupportsADParticipantEntryId); array = participantEntryId.ToByteArray(); } else if (permission.Principal.Type == PermissionSecurityPrincipal.SecurityPrincipalType.ExternalUserPrincipal) { ExternalUser externalUser = permission.Principal.ExternalUser; byte[] array2 = new byte[externalUser.Sid.BinaryLength]; externalUser.Sid.GetBinaryForm(array2, 0); array = MapiStore.GetAddressBookEntryIdFromLocalDirectorySID(array2); } if (array != null) { mapiAclTableAdapter.AddPermissionEntry(array, permission.MemberRights); } } else if (permission.IsDirty) { mapiAclTableAdapter.ModifyPermissionEntry(permission.MemberId, permission.MemberRights); } } if (this.anonymousMemberPermission != null && this.anonymousMemberPermission.IsDirty) { mapiAclTableAdapter.ModifyPermissionEntry(this.anonymousMemberPermission.MemberId, this.anonymousMemberPermission.MemberRights); } if (this.defaultMemberPermission != null && this.defaultMemberPermission.IsDirty) { mapiAclTableAdapter.ModifyPermissionEntry(this.defaultMemberPermission.MemberId, this.defaultMemberPermission.MemberRights); } }