protected void ResolveParticipants(ConversionAddressCollection.ParticipantResolutionList resolutionList)
 {
     Participant.Job job = resolutionList.CreateResolutionJob();
     if (this.ewsOutboundMimeConversion)
     {
         PropertyDefinition propertyDefinition;
         Participant.BatchBuilder.Execute(job, new Participant.BatchBuilder[]
         {
             Participant.BatchBuilder.ConvertRoutingType(this.TargetResolutionType, out propertyDefinition),
             Participant.BatchBuilder.RequestAllProperties(),
             Participant.BatchBuilder.CopyPropertiesFromInput(),
             Participant.BatchBuilder.GetPropertiesFromAD(this.GetRecipientCache(job.Count), null),
             this.useSimpleDisplayName ? Participant.BatchBuilder.ReplaceProperty(ParticipantSchema.DisplayName, ParticipantSchema.SimpleDisplayName) : null
         });
     }
     else
     {
         PropertyDefinition propertyDefinition;
         Participant.BatchBuilder.Execute(job, new Participant.BatchBuilder[]
         {
             Participant.BatchBuilder.ConvertRoutingType(this.TargetResolutionType, out propertyDefinition),
             Participant.BatchBuilder.RequestAllProperties(),
             Participant.BatchBuilder.GetPropertiesFromAD(this.GetRecipientCache(job.Count), null),
             Participant.BatchBuilder.CopyPropertiesFromInput(),
             this.useSimpleDisplayName ? Participant.BatchBuilder.ReplaceProperty(ParticipantSchema.DisplayName, ParticipantSchema.SimpleDisplayName) : null
         });
     }
     job.ApplyResults();
 }
예제 #2
0
 internal void LoadAdditionalParticipantProperties(PropertyDefinition[] keyProperties)
 {
     this.CheckDisposed(null);
     if (StandaloneFuzzing.IsEnabled)
     {
         return;
     }
     Participant.Job job = new Participant.Job(this.Count);
     foreach (CoreRecipient coreRecipient in this)
     {
         if (coreRecipient.Participant == null)
         {
             throw new InvalidOperationException("The Participant is not present. This recipient has not been fully formed.");
         }
         job.Add(new Participant.JobItem((coreRecipient.Participant.RoutingType == "EX") ? coreRecipient.Participant : null));
     }
     this.ExecuteJob(job, keyProperties);
     for (int i = 0; i < this.Count; i++)
     {
         if (job[i].Result != null && job[i].Error == null)
         {
             Participant participant = job[i].Result.ToParticipant();
             if (participant.ValidationStatus == ParticipantValidationStatus.NoError)
             {
                 this.recipientList[i].InternalUpdateParticipant(participant);
             }
         }
     }
 }
 internal Participant.Job CreateResolutionJob()
 {
     Participant.Job job = new Participant.Job(this.originalParticipantList.Count);
     foreach (Participant input in this.originalParticipantList)
     {
         job.Add(new Participant.JobItem(input, new Action <Result <Participant> >(this.AddResolvedParticipant)));
     }
     return(job);
 }
예제 #4
0
        internal void ExecuteJob(Participant.Job job, PropertyDefinition[] keyProperties)
        {
            ADSessionSettings adsessionSettings = Participant.BatchBuilder.GetADSessionSettings(this.CoreItem);

            Participant.BatchBuilder.Execute(job, new Participant.BatchBuilder[]
            {
                Participant.BatchBuilder.RequestAllProperties(),
                Participant.BatchBuilder.CopyPropertiesFromInput(),
                Participant.BatchBuilder.GetPropertiesFromAD(null, adsessionSettings, keyProperties)
            });
        }
예제 #5
0
        public static int GetSMTPAddressesForParticipantsIfNecessary(Participant[] participants, RecipientCollection collection)
        {
            int num = 0;

            Participant.Job job  = new Participant.Job(participants.Length);
            bool            flag = false;

            foreach (Participant participant in participants)
            {
                Participant participant2 = (participant.RoutingType == "EX") ? participant : null;
                if (participant2 != null)
                {
                    flag = true;
                    num++;
                }
                job.Add(new Participant.JobItem(participant2));
            }
            if (!flag)
            {
                return(num);
            }
            StoreSession      session           = collection.CoreItem.Session;
            ADSessionSettings adsessionSettings = Participant.BatchBuilder.GetADSessionSettings(session);

            Participant.BatchBuilder.Execute(job, new Participant.BatchBuilder[]
            {
                Participant.BatchBuilder.RequestAllProperties(),
                Participant.BatchBuilder.CopyPropertiesFromInput(),
                Participant.BatchBuilder.GetPropertiesFromAD(null, adsessionSettings, new PropertyDefinition[]
                {
                    ParticipantSchema.SmtpAddress
                })
            });
            for (int j = 0; j < participants.Length; j++)
            {
                if (job[j].Result != null && job[j].Error == null)
                {
                    Participant participant3 = job[j].Result.ToParticipant();
                    if (participant3.ValidationStatus == ParticipantValidationStatus.NoError)
                    {
                        participants[j] = participant3;
                    }
                }
            }
            return(num);
        }