// Token: 0x06002F14 RID: 12052 RVA: 0x0010F610 File Offset: 0x0010D810
 private void RenderContactProperties(RecipientWellEventHandler.ContactRecipientProperties contactRecipientProperties)
 {
     this.Writer.Write("<div>");
     if (string.IsNullOrEmpty(contactRecipientProperties.WorkPhone))
     {
         this.Writer.Write("<span id=\"{0}\">{1}</span>", "CWPh", LocalizedStrings.GetHtmlEncoded(1766818386));
     }
     else
     {
         this.Writer.Write("<span id=\"{0}\">{1}</span>", "CWPh", Utilities.HtmlEncode(contactRecipientProperties.WorkPhone));
     }
     if (string.IsNullOrEmpty(contactRecipientProperties.HomePhone))
     {
         this.Writer.Write("<span id=\"{0}\">{1}</span>", "CHPh", LocalizedStrings.GetHtmlEncoded(1766818386));
     }
     else
     {
         this.Writer.Write("<span id=\"{0}\">{1}</span>", "CHPh", Utilities.HtmlEncode(contactRecipientProperties.HomePhone));
     }
     if (string.IsNullOrEmpty(contactRecipientProperties.MobilePhone))
     {
         this.Writer.Write("<span id=\"{0}\">{1}</span>", "CMPh", LocalizedStrings.GetHtmlEncoded(1766818386));
     }
     else
     {
         this.Writer.Write("<span id=\"{0}\">{1}</span>", "CMPh", Utilities.HtmlEncode(contactRecipientProperties.MobilePhone));
     }
     this.Writer.Write("</div>");
 }
        // Token: 0x06002F24 RID: 12068 RVA: 0x0010FEF0 File Offset: 0x0010E0F0
        public RecipientWellEventHandler.ContactRecipientProperties GetContactRecipientProperties(StoreObjectId contactId, UserContext userContext)
        {
            if (contactId == null)
            {
                throw new ArgumentNullException("contactId");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            Contact contact = null;

            RecipientWellEventHandler.ContactRecipientProperties result = default(RecipientWellEventHandler.ContactRecipientProperties);
            try
            {
                PropertyDefinition[] propsToReturn = new PropertyDefinition[]
                {
                    ContactSchema.BusinessPhoneNumber,
                    ContactSchema.MobilePhone,
                    ContactSchema.HomePhone
                };
                contact            = Contact.Bind(userContext.MailboxSession, contactId, propsToReturn);
                result.WorkPhone   = (contact.TryGetProperty(ContactSchema.BusinessPhoneNumber) as string);
                result.HomePhone   = (contact.TryGetProperty(ContactSchema.HomePhone) as string);
                result.MobilePhone = (contact.TryGetProperty(ContactSchema.MobilePhone) as string);
            }
            catch (ObjectNotFoundException arg)
            {
                ExTraceGlobals.ContactsDataTracer.TraceDebug <ObjectNotFoundException>(0L, "Contact item could not be found.  Exception: {0}", arg);
                base.RenderPartialFailure(string.Empty, null, ButtonDialogIcon.NotSet, OwaEventHandlerErrorCode.NotSet);
            }
            finally
            {
                if (contact != null)
                {
                    contact.Dispose();
                    contact = null;
                }
            }
            return(result);
        }
 // Token: 0x06002F25 RID: 12069 RVA: 0x0010FFF0 File Offset: 0x0010E1F0
 public RecipientWellEventHandler.ContactRecipientProperties GetContactRecipientProperties(string email, UserContext userContext)
 {
     if (email == null)
     {
         throw new ArgumentNullException("email");
     }
     if (userContext == null)
     {
         throw new ArgumentNullException("userContext");
     }
     RecipientWellEventHandler.ContactRecipientProperties result = default(RecipientWellEventHandler.ContactRecipientProperties);
     using (ContactsFolder contactsFolder = ContactsFolder.Bind(userContext.MailboxSession, DefaultFolderType.Contacts))
     {
         using (FindInfo <Contact> findInfo = contactsFolder.FindByEmailAddress(email, new PropertyDefinition[0]))
         {
             if (findInfo.FindStatus == FindStatus.Found)
             {
                 Contact result2 = findInfo.Result;
                 result2.Load(new PropertyDefinition[]
                 {
                     ContactSchema.BusinessPhoneNumber,
                     ContactSchema.MobilePhone,
                     ContactSchema.HomePhone
                 });
                 result.WorkPhone   = (result2.TryGetProperty(ContactSchema.BusinessPhoneNumber) as string);
                 result.HomePhone   = (result2.TryGetProperty(ContactSchema.HomePhone) as string);
                 result.MobilePhone = (result2.TryGetProperty(ContactSchema.MobilePhone) as string);
             }
             else
             {
                 ExTraceGlobals.ContactsDataTracer.TraceDebug(0L, "Contact item could not be found.");
                 base.RenderPartialFailure(string.Empty, null, ButtonDialogIcon.NotSet, OwaEventHandlerErrorCode.NotSet);
             }
         }
     }
     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;
            }
        }