string GetValue(ABMultiValue <string> multiProperty, int identifier) { nint i = multiProperty.GetIndexForIdentifier(identifier); string[] values = multiProperty.GetValues(); return(values [(int)i]); }
public static string GetPickedEmail(ABPerson person, int?identifier = null) { string emailAddress = "no email address"; using (ABMultiValue <string> emails = person.GetEmails()) { bool emailExists = emails != null && emails.Count > 0; if (emailExists) { nint index = identifier.HasValue ? emails.GetIndexForIdentifier(identifier.Value) : 0; emailAddress = emails [index].Value; } } return(string.Format("Picked {0}", emailAddress)); }
string GetValue(ABMultiValue<string> multiProperty, int identifier) { nint i = multiProperty.GetIndexForIdentifier (identifier); string[] values = multiProperty.GetValues (); return values [(int)i]; }