/// <summary>
        /// Set all those properties of this outlook item whose values are different from the
        /// equivalent values on this CRM item. Update the synchronisation properties only if some
        /// other property has actually changed.
        /// </summary>
        /// <param name="crmItem">The CRM item from which to take values.</param>
        /// <param name="outlookItem">The Outlook item into which to insert values.</param>
        /// <returns>true if anything was changed.</returns>
        private void SetOutlookItemPropertiesFromCrmItem(eEntryValue crmItem, Outlook.ContactItem outlookItem)
        {
            outlookItem.FirstName                 = crmItem.GetValueAsString("first_name");
            outlookItem.LastName                  = crmItem.GetValueAsString("last_name");
            outlookItem.Email1Address             = crmItem.GetValueAsString("email1");
            outlookItem.BusinessTelephoneNumber   = crmItem.GetValueAsString("phone_work");
            outlookItem.HomeTelephoneNumber       = crmItem.GetValueAsString("phone_home");
            outlookItem.MobileTelephoneNumber     = crmItem.GetValueAsString("phone_mobile");
            outlookItem.JobTitle                  = crmItem.GetValueAsString("title");
            outlookItem.Department                = crmItem.GetValueAsString("department");
            outlookItem.BusinessAddressCity       = crmItem.GetValueAsString("primary_address_city");
            outlookItem.BusinessAddressCountry    = crmItem.GetValueAsString("primary_address_country");
            outlookItem.BusinessAddressPostalCode = crmItem.GetValueAsString("primary_address_postalcode");
            outlookItem.BusinessAddressState      = crmItem.GetValueAsString("primary_address_state");
            outlookItem.BusinessAddressStreet     = crmItem.GetValueAsString("primary_address_street");
            outlookItem.Body = crmItem.GetValueAsString("description");
            if (crmItem.GetValue("account_name") != null)
            {
                outlookItem.Account     = crmItem.GetValueAsString("account_name");
                outlookItem.CompanyName = crmItem.GetValueAsString("account_name");
            }
            outlookItem.BusinessFaxNumber = crmItem.GetValueAsString("phone_fax");
            outlookItem.Title             = crmItem.GetValueAsString("salutation");

            EnsureSynchronisationPropertiesForOutlookItem(
                outlookItem,
                crmItem.GetValueAsString("date_modified"),
                crmItem.GetValueAsString("sync_contact"),
                crmItem.GetValueAsString("id"));
        }
        /// <summary>
        /// Return true if this CRM contact should be synchronised with Outlook.
        /// </summary>
        /// <remarks>
        /// If the 'Sync to Outlook' field is set in CRM, we get 'true' as the value of crmItem.sync_contact.
        /// But if the field is not set, we do not (or do not reliably) get 'false'. The sync_contact
        /// property may have a value of ''.
        /// </remarks>
        /// <param name="crmContact">The CRM contact.</param>
        /// <returns>true if this CRM contact should be synchronised with Outlook.</returns>
        private bool ShouldSyncContact(eEntryValue crmContact)
        {
            object val = crmContact.GetValue("sync_contact");

            return(Boolean.TrueString.ToLower().Equals(val.ToString().ToLower()));
        }