public static ParticipantEntryId FromParticipant(Participant participant, ParticipantEntryIdConsumer consumer) { if (participant == null) { throw new ArgumentNullException("participant"); } EnumValidator.ThrowIfInvalid <ParticipantEntryIdConsumer>(consumer); ParticipantEntryId participantEntryId = null; foreach (ParticipantEntryId.TryFromParticipantDelegate tryFromParticipantDelegate in ParticipantEntryId.tryFromParticipantChain) { participantEntryId = tryFromParticipantDelegate(participant, consumer); if (participantEntryId != null) { break; } } return(participantEntryId); }
protected EmbeddedParticipantProperty(string displayName, ParticipantEntryIdConsumer entryIdConsumer, NativeStorePropertyDefinition displayNamePropertyDefinition, NativeStorePropertyDefinition emailAddressPropertyDefinition, NativeStorePropertyDefinition routingTypePropertyDefinition, NativeStorePropertyDefinition entryIdPropertyDefinition, NativeStorePropertyDefinition smtpAddressPropertyDefinition, NativeStorePropertyDefinition sipUriPropertyDefinition, NativeStorePropertyDefinition sidPropertyDefinition, NativeStorePropertyDefinition guidPropertyDefinition, params PropertyDependency[] additionalDependencies) : base(displayName, typeof(Participant), PropertyFlags.None, Array <PropertyDefinitionConstraint> .Empty, EmbeddedParticipantProperty.GetDependencies(additionalDependencies, new NativeStorePropertyDefinition[] { displayNamePropertyDefinition, emailAddressPropertyDefinition, routingTypePropertyDefinition, entryIdPropertyDefinition, smtpAddressPropertyDefinition, sipUriPropertyDefinition, sidPropertyDefinition, guidPropertyDefinition })) { this.entryIdConsumer = entryIdConsumer; this.displayNamePropDef = displayNamePropertyDefinition; this.emailAddressPropDef = emailAddressPropertyDefinition; this.routingTypePropDef = routingTypePropertyDefinition; this.entryIdPropDef = entryIdPropertyDefinition; this.smtpAddressPropDef = smtpAddressPropertyDefinition; this.sipUriPropDef = sipUriPropertyDefinition; this.sidPropDef = sidPropertyDefinition; this.guidPropDef = guidPropertyDefinition; }
internal static OneOffParticipantEntryId TryFromParticipant(Participant participant, ParticipantEntryIdConsumer consumer) { if (!(participant.Origin is OneOffParticipantOrigin)) { Participant participant2 = participant.ChangeOrigin(new OneOffParticipantOrigin()); if (!participant.AreAddressesEqual(participant2)) { return(null); } participant = participant2; } if (participant.RoutingType != null) { return(new OneOffParticipantEntryId(participant)); } return(null); }
internal static StoreParticipantEntryId TryFromParticipant(Participant participant, ParticipantEntryIdConsumer consumer) { if ((consumer & ParticipantEntryIdConsumer.SupportsStoreParticipantEntryId) != ParticipantEntryIdConsumer.SupportsNone || (participant.RoutingType == "MAPIPDL" && (consumer & ParticipantEntryIdConsumer.SupportsStoreParticipantEntryIdForPDLs) != ParticipantEntryIdConsumer.SupportsNone)) { StoreParticipantOrigin storeParticipantOrigin = participant.Origin as StoreParticipantOrigin; if (storeParticipantOrigin != null) { return(new StoreParticipantEntryId(storeParticipantOrigin.OriginItemId, participant.RoutingType == "MAPIPDL", storeParticipantOrigin.EmailAddressIndex, (consumer & ParticipantEntryIdConsumer.SupportsWindowsAddressBookEnvelope) != ParticipantEntryIdConsumer.SupportsNone)); } if (participant.RoutingType == "MAPIPDL") { ExTraceGlobals.StorageTracer.TraceDebug <Participant>((long)participant.GetHashCode(), "Cannot create an entry id: ContactDL should have StoreParticipantOrigin: {0}", participant); } } return(null); }
internal static ADParticipantEntryId TryFromParticipant(Participant participant, ParticipantEntryIdConsumer consumer) { if ((consumer & ParticipantEntryIdConsumer.SupportsADParticipantEntryId) != ParticipantEntryIdConsumer.SupportsNone && participant.RoutingType == "EX") { return(new ADParticipantEntryId(participant.EmailAddress, participant.GetValueAsNullable <LegacyRecipientDisplayType>(ParticipantSchema.DisplayType), (consumer & ParticipantEntryIdConsumer.SupportsWindowsAddressBookEnvelope) != ParticipantEntryIdConsumer.SupportsNone)); } return(null); }
internal EmbeddedParticipantProperty(string displayName, ParticipantEntryIdConsumer entryIdConsumer, NativeStorePropertyDefinition displayNamePropertyDefinition, NativeStorePropertyDefinition emailAddressPropertyDefinition, NativeStorePropertyDefinition routingTypePropertyDefinition, NativeStorePropertyDefinition entryIdPropertyDefinition, NativeStorePropertyDefinition smtpAddressPropertyDefinition, NativeStorePropertyDefinition sipUriPropertyDefinition, NativeStorePropertyDefinition sidPropertyDefinition, NativeStorePropertyDefinition guidPropertyDefinition) : this(displayName, entryIdConsumer, displayNamePropertyDefinition, emailAddressPropertyDefinition, routingTypePropertyDefinition, entryIdPropertyDefinition, smtpAddressPropertyDefinition, sipUriPropertyDefinition, sidPropertyDefinition, guidPropertyDefinition, Array <PropertyDependency> .Empty) { }