// Token: 0x06002F23 RID: 12067 RVA: 0x0010FD4C File Offset: 0x0010DF4C
        private RecipientWellEventHandler.ADRecipientProperties GetADRecipientProperties(ADObjectId adObjectId, string routingAddress, string routingType)
        {
            if (string.IsNullOrEmpty(routingAddress))
            {
                throw new ArgumentNullException("routingAddress");
            }
            if (string.IsNullOrEmpty(routingType))
            {
                throw new ArgumentNullException("routingType");
            }
            IRecipientSession recipientSession = Utilities.CreateADRecipientSession(Culture.GetUserCulture().LCID, true, ConsistencyMode.IgnoreInvalid, true, base.UserContext);
            ADRecipient       adrecipient      = null;

            RecipientWellEventHandler.ADRecipientProperties result = default(RecipientWellEventHandler.ADRecipientProperties);
            if (string.Equals(routingType, "EX", StringComparison.Ordinal))
            {
                try
                {
                    CustomProxyAddress proxyAddress = new CustomProxyAddress((CustomProxyAddressPrefix)ProxyAddressPrefix.LegacyDN, routingAddress, true);
                    adrecipient = recipientSession.FindByProxyAddress(proxyAddress);
                    goto IL_FB;
                }
                catch (NonUniqueRecipientException ex)
                {
                    ExTraceGlobals.CoreTracer.TraceDebug <string>((long)this.GetHashCode(), "GetADRecipientProperties: NonUniqueRecipientException was thrown by FindByProxyAddress: {0}", ex.Message);
                    throw new OwaEventHandlerException("Unable to retrieve properties.", LocalizedStrings.GetNonEncoded(-1953304495));
                }
            }
            if (string.Equals(routingType, "SMTP", StringComparison.Ordinal))
            {
                try
                {
                    SmtpProxyAddress proxyAddress2 = new SmtpProxyAddress(routingAddress, true);
                    adrecipient = recipientSession.FindByProxyAddress(proxyAddress2);
                }
                catch (NonUniqueRecipientException ex2)
                {
                    ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "GetADRecipientProperties: NonUniqueRecipientException was thrown by FindByProxyAddress: {0}", ex2.Message);
                    throw new OwaEventHandlerException("Unable to retrieve properties.", LocalizedStrings.GetNonEncoded(-1953304495));
                }
            }
IL_FB:
            if (adrecipient == null && adObjectId != null)
            {
                adrecipient = recipientSession.Read(adObjectId);
            }
            if (adrecipient == null)
            {
                throw new OwaEventHandlerException("Unable to retrieve properties.", LocalizedStrings.GetNonEncoded(-1953304495));
            }
            IADOrgPerson iadorgPerson = adrecipient as IADOrgPerson;

            if (iadorgPerson != null)
            {
                result.Office = iadorgPerson.Office;
                result.Phone  = iadorgPerson.Phone;
                if (adrecipient.Id == null)
                {
                    throw new OwaEventHandlerException("Unable to retrieve id for AD Recipient.", LocalizedStrings.GetNonEncoded(-1953304495));
                }
                result.Id = DirectoryAssistance.ToHtmlString(adrecipient.Id);
            }
            return(result);
        }
        public void GetRecipientMenuProperties()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "RecipientWellEventHandler.GetRecipientMenuProperties");
            AddressOrigin addressOrigin = (AddressOrigin)base.GetParameter("ao");
            string        text          = null;

            if (base.IsParameterSet("em"))
            {
                text = (string)base.GetParameter("em");
            }
            string routingType = (string)base.GetParameter("rt");

            switch (addressOrigin)
            {
            case AddressOrigin.Store:
            {
                if (!base.IsParameterSet("id"))
                {
                    throw new OwaInvalidRequestException("Missing contact id.");
                }
                StoreObjectId contactId = Utilities.CreateStoreObjectId((string)base.GetParameter("id"));
                RecipientWellEventHandler.ContactRecipientProperties contactRecipientProperties = this.GetContactRecipientProperties(contactId, base.UserContext);
                this.RenderContactProperties(contactRecipientProperties);
                return;
            }

            case AddressOrigin.Directory:
            {
                if (text == null)
                {
                    throw new OwaInvalidRequestException("Missing email address.");
                }
                ADObjectId adObjectId = null;
                if (base.IsParameterSet("id"))
                {
                    adObjectId = DirectoryAssistance.ParseADObjectId((string)base.GetParameter("id"));
                }
                RecipientWellEventHandler.ADRecipientProperties adrecipientProperties = this.GetADRecipientProperties(adObjectId, text, routingType);
                this.Writer.Write("<div>");
                if (string.IsNullOrEmpty(adrecipientProperties.Office))
                {
                    this.Writer.Write("<span id=\"{0}\">{1}</span>", "AdOf", LocalizedStrings.GetHtmlEncoded(1766818386));
                }
                else
                {
                    this.Writer.Write("<span id=\"{0}\">{1}</span>", "AdOf", Utilities.HtmlEncode(adrecipientProperties.Office));
                }
                if (string.IsNullOrEmpty(adrecipientProperties.Phone))
                {
                    this.Writer.Write("<span id=\"{0}\">{1}</span>", "AdPh", LocalizedStrings.GetHtmlEncoded(1766818386));
                }
                else
                {
                    this.Writer.Write("<span id=\"{0}\">{1}</span>", "AdPh", Utilities.HtmlEncode(adrecipientProperties.Phone));
                }
                if (!string.IsNullOrEmpty(adrecipientProperties.Id))
                {
                    this.Writer.Write("<span id=\"{0}\">{1}</span>", "AdId", Utilities.HtmlEncode(adrecipientProperties.Id));
                }
                this.Writer.Write("</div>");
                return;
            }

            case AddressOrigin.OneOff:
            {
                RecipientWellEventHandler.ContactRecipientProperties contactRecipientProperties2 = this.GetContactRecipientProperties(text, base.UserContext);
                this.RenderContactProperties(contactRecipientProperties2);
                return;
            }

            default:
                return;
            }
        }