public static Participant[] ConvertToSmtp(Participant[] participants, IMailboxSession mailboxSession)
        {
            Dictionary <string, Participant> dictionary = new Dictionary <string, Participant>();
            List <Participant> list = new List <Participant>();

            foreach (Participant participant in participants)
            {
                if (!dictionary.ContainsKey(participant.EmailAddress))
                {
                    if (string.Equals(participant.RoutingType, "SMTP", StringComparison.OrdinalIgnoreCase))
                    {
                        dictionary.Add(participant.EmailAddress, participant);
                    }
                    else
                    {
                        string valueOrDefault = participant.GetValueOrDefault <string>(ParticipantSchema.SmtpAddress);
                        if (!string.IsNullOrEmpty(valueOrDefault))
                        {
                            Participant value = new Participant(participant.DisplayName, valueOrDefault, "SMTP", participant.Origin, new KeyValuePair <PropertyDefinition, object> [0]);
                            dictionary.Add(participant.EmailAddress, value);
                        }
                        else
                        {
                            list.Add(participant);
                        }
                    }
                }
            }
            if (list.Count > 0)
            {
                Participant[] array  = list.ToArray();
                Participant[] array2 = ParticipantRoutingTypeConverter.ResolveParticipantsFromAD(array, "SMTP", mailboxSession);
                for (int j = 0; j < array.Length; j++)
                {
                    if (!dictionary.ContainsKey(array[j].EmailAddress))
                    {
                        dictionary.Add(array[j].EmailAddress, array2[j] ?? array[j]);
                    }
                }
            }
            Participant[] array3 = new Participant[participants.Length];
            for (int k = 0; k < participants.Length; k++)
            {
                array3[k] = dictionary[participants[k].EmailAddress];
            }
            return(array3);
        }
        protected virtual Participant[] Convert(Participant[] value, string destinationRoutingType)
        {
            IMailboxSession mailboxSession = this.Session as IMailboxSession;

            if (mailboxSession == null)
            {
                ExTraceGlobals.ConvertersTracer.TraceDebug <string>(0L, "Provided session ({0}) is not supported for participant conversion.", this.Session.GetType().Name);
                return(value);
            }
            if (string.Equals(destinationRoutingType, "SMTP", StringComparison.OrdinalIgnoreCase))
            {
                return(ParticipantRoutingTypeConverter.ConvertToSmtp(value, mailboxSession));
            }
            Participant[] array  = ParticipantRoutingTypeConverter.ResolveParticipantsFromAD(value, destinationRoutingType, mailboxSession);
            Participant[] array2 = new Participant[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                array2[i] = (array[i] ?? value[i]);
            }
            return(array2);
        }