Esempio n. 1
0
        private static string LegDNFromParticipantEntryId(byte[] entryId)
        {
            if (entryId == null || entryId.Length == 0)
            {
                return(null);
            }
            ADParticipantEntryId adparticipantEntryId = ParticipantEntryId.TryFromEntryId(entryId) as ADParticipantEntryId;

            if (adparticipantEntryId != null)
            {
                Participant.Builder builder = new Participant.Builder();
                builder.SetPropertiesFrom(adparticipantEntryId);
                return(builder.ToParticipant().EmailAddress);
            }
            return(null);
        }
Esempio n. 2
0
        private static byte[] ParticipanEntryIdFromLegDN(byte[] originalEntryId, string newLegDN)
        {
            if (originalEntryId == null || originalEntryId.Length == 0)
            {
                return(null);
            }
            ADParticipantEntryId adparticipantEntryId = ParticipantEntryId.TryFromEntryId(originalEntryId) as ADParticipantEntryId;

            if (adparticipantEntryId == null)
            {
                return(null);
            }
            Participant.Builder builder = new Participant.Builder();
            builder.SetPropertiesFrom(adparticipantEntryId);
            builder.EmailAddress = newLegDN;
            ParticipantEntryId participantEntryId = ParticipantEntryId.FromParticipant(builder.ToParticipant(), ParticipantEntryIdConsumer.RecipientTableSecondary);

            if (participantEntryId == null)
            {
                return(null);
            }
            return(participantEntryId.ToByteArray());
        }