private void ExportPhones(IContact contactBO, IEMAPIProp message) { string otherCandidat = null; bool wasOther = false; foreach (string phoneName in contactBO.GetPhoneNames()) { if (phoneName == Phone.Other.Name) { wasOther = true; } Phone phone = Phone.GetPhone(phoneName); if (phone != null) { message.SetStringProp(phone.MAPIPhoneAsInt, contactBO.GetPhoneNumber(phoneName)); } else if (otherCandidat == null) { otherCandidat = phoneName; } } if (!wasOther && otherCandidat != null) { message.SetStringProp(Phone.Other.MAPIPhoneAsInt, contactBO.GetPhoneNumber(otherCandidat)); } if (!wasOther && otherCandidat == null) { message.SetStringProp(Phone.Other.MAPIPhoneAsInt, ""); } }
private void ExportProperties(IEMAPIProp message, IContact contactBO) { if (!_createdAsMailUser) { int tag = message.GetIDsFromNames(ref GUID.set3, lID.contactDisplayName, PropType.PT_STRING8); message.SetStringProp(tag, _contact.DisplayName); } // LX: This causes setting of the contact's email address equal to the // "DisplayName" if it is not set later explicitely. // message.SetStringProp( MAPIConst.PR_DISPLAY_NAME, _contact.DisplayName ); if (!String.IsNullOrEmpty(contactBO.Title)) { message.SetStringProp(MAPIConst.PR_DISPLAY_NAME_PREFIX, contactBO.Title); } message.SetStringProp(MAPIConst.PR_GIVEN_NAME, contactBO.FirstName); if (!String.IsNullOrEmpty(contactBO.MiddleName)) { message.SetStringProp(MAPIConst.PR_MIDDLE_NAME, contactBO.MiddleName); } message.SetStringProp(MAPIConst.PR_SURNAME, contactBO.LastName); if (!String.IsNullOrEmpty(contactBO.Suffix)) { message.SetStringProp(MAPIConst.PR_GENERATION, contactBO.Suffix); } message.SetDateTimeProp(MAPIConst.PR_BIRTHDAY, contactBO.Birthday); message.SetStringProp(MAPIConst.PR_COMPANY_NAME, contactBO.Company); message.SetStringProp(MAPIConst.PR_BUSINESS_HOME_PAGE, contactBO.HomePage); message.SetStringProp(MAPIConst.PR_TITLE, contactBO.JobTitle); message.SetStringProp(MAPIConst.PR_POSTAL_ADDRESS, contactBO.Address); message.WriteStringStreamProp(MAPIConst.PR_BODY, contactBO.Description); }
private void SetEmailAddress(IEMAPIProp message) { IResourceList emails = _contact.GetLinksOfType("EmailAccount", Core.ContactManager.Props.LinkEmailAcct); if (emails.Count > 0) { IResource email = emails[0]; string emailText = email.GetPropText(Core.ContactManager.Props.EmailAddress); if (emailText.Length > 0) { int tag = message.GetIDsFromNames(ref GUID.set3, lID.contactEmail, PropType.PT_STRING8); message.SetStringProp(tag, emailText); message.SetStringProp(MAPIConst.PR_EMAIL_ADDRESS, emailText); message.SetStringProp(MAPIConst.PR_CONTACT_EMAIL_ADDRESS, emailText); message.SetStringProp(MAPIConst.PR_CONTACT_EMAIL_ADDRESS1, emailText); } } }