/// <summary>Commit a position in the contact's collection of positions.</summary> /// <param name="contact">The contact that is having this position committed.</param> /// <param name="arrayNode">The array node where this position is being committed.</param> /// <param name="value">The position being committed.</param> private static void _CommitPosition(Contact contact, string arrayNode, Position value) { Assert.IsTrue(arrayNode.StartsWith(PropertyNames.PositionCollection + PropertyNames.PositionArrayNode, StringComparison.Ordinal)); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Company, value.Company); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Department, value.Department); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.JobTitle, value.JobTitle); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Office, value.Office); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Organization, value.Organization); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Profession, value.Profession); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Role, value.Role); }
/// <summary>Commit a url in the contact's collection of urls.</summary> /// <param name="contact">The contact that is having this url committed.</param> /// <param name="arrayNode">The array node where this url is being committed.</param> /// <param name="value">The url being committed.</param> private static void _CommitUrl(Contact contact, string arrayNode, Uri value) { Assert.IsTrue(arrayNode.StartsWith(PropertyNames.UrlCollection + PropertyNames.UrlArrayNode, StringComparison.Ordinal)); string url = (null == value) ? null : value.ToString(); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Value, url); }
/// <summary>Commit a person in the contact's collection of people.</summary> /// <param name="contact">The contact that is having this person committed.</param> /// <param name="arrayNode">The array node where this person is being committed.</param> /// <param name="value">The person being committed.</param> private static void _CommitPerson(Contact contact, string arrayNode, Person value) { Assert.IsTrue(arrayNode.StartsWith(PropertyNames.PersonCollection + PropertyNames.PersonArrayNode, StringComparison.Ordinal)); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.FormattedName, value.Name); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.PersonId, value.Id); }
/// <summary>Commit a photo struct in the contact's collection of photos.</summary> /// <param name="contact">The contact that is having this photo committed.</param> /// <param name="arrayNode">The array node where this photo is being committed.</param> /// <param name="value">The photo being committed.</param> private static void _CommitPhoto(Contact contact, string arrayNode, Photo value) { Assert.IsTrue(arrayNode.StartsWith(PropertyNames.PhotoCollection + PropertyNames.PhotoArrayNode, StringComparison.Ordinal)); contact._SetOrRemoveBinaryProperty(arrayNode + PropertyNames.Value, value.Value, value.ValueType); string url = null; if (null != value.Url) { url = value.Url.ToString(); } contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Url, url); }
/// <summary>Commit a phone number in the contact's collection of numbers.</summary> /// <param name="contact">The contact that is having this number committed.</param> /// <param name="arrayNode">The array node where this number is being committed.</param> /// <param name="value">The number being committed.</param> private static void _CommitNumber(Contact contact, string arrayNode, PhoneNumber value) { Assert.IsTrue(arrayNode.StartsWith(PropertyNames.PhoneNumberCollection + PropertyNames.PhoneNumberArrayNode, StringComparison.Ordinal)); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Alternate, value.Alternate); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Number, value.Number); }
/// <summary>Commit a name in the contact's collection of names.</summary> /// <param name="contact">The contact that is having this name committed.</param> /// <param name="arrayNode">The array node where this name is being committed.</param> /// <param name="value">The name being committed.</param> private static void _CommitName(Contact contact, string arrayNode, Name value) { Assert.IsTrue(arrayNode.StartsWith(PropertyNames.NameCollection + PropertyNames.NameArrayNode, StringComparison.Ordinal)); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.FamilyName, value.FamilyName); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.FormattedName, value.FormattedName); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Generation, value.Generation); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.GivenName, value.GivenName); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.MiddleName, value.MiddleName); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Nickname, value.Nickname); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Title, value.PersonalTitle); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Phonetic, value.Phonetic); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Prefix, value.Prefix); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Suffix, value.Suffix); }
/// <summary>Commit an instant message struct in the contact's collection of instant messages.</summary> /// <param name="contact">The contact that is having this IM struct committed.</param> /// <param name="arrayNode">The array node where this IM struct is being committed.</param> /// <param name="value">The IM struct being committed.</param> private static void _CommitIM(Contact contact, string arrayNode, IMAddress value) { Assert.IsTrue(arrayNode.StartsWith(PropertyNames.IMAddressCollection + PropertyNames.IMAddressArrayNode, StringComparison.Ordinal)); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Value, value.Handle); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Protocol , value.Protocol); }
/// <summary>Commit an EmailAddress in the contact's collection of e-mail addresses.</summary> /// <param name="contact">The contact that is having this e-mail committed.</param> /// <param name="arrayNode">The array node where this e-mail is being committed.</param> /// <param name="value">The e-mail address being committed.</param> private static void _CommitEmail(Contact contact, string arrayNode, EmailAddress value) { Assert.IsTrue(arrayNode.StartsWith(PropertyNames.EmailAddressCollection + PropertyNames.EmailAddressArrayNode, StringComparison.Ordinal)); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Address, value.Address); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.AddressType, value.AddressType); }
/// <summary>Commit a physical address in the contact's collection of addresses.</summary> /// <param name="contact">The contact that is having this address committed.</param> /// <param name="arrayNode">The array node where this address is being committed.</param> /// <param name="value">The address being committed.</param> private static void _CommitAddress(Contact contact, string arrayNode, PhysicalAddress value) { Assert.IsTrue(arrayNode.StartsWith(PropertyNames.PhysicalAddressCollection + PropertyNames.PhysicalAddressArrayNode, StringComparison.Ordinal)); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.AddressLabel, value.AddressLabel); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Locality, value.City); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Country, value.Country); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.ExtendedAddress, value.ExtendedAddress); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.POBox, value.POBox); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Region, value.State); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.Street, value.Street); contact._SetOrRemoveStringProperty(arrayNode + PropertyNames.PostalCode, value.ZipCode); }