/// <summary> /// Set the tag id of the tag that matches the entry book address properties. If /// no email address is assigned, then no address book entry is used. Otherwise /// the first character of the displayName is used. /// </summary> /// <param name="entry">The address book entry to set the tag id for.</param> private void SetTagId(AddressBookEntry entry) { if (entry == null) { return; } if (String.IsNullOrEmpty(entry.EmailAddress)) { return; } uint?tagId = GetTagId(entry.DisplayName); if ((tagId != null) && (tagId > 0)) { entry.Set("tagId", String.Format("1,{0}", tagId)); } }