コード例 #1
0
        string GetValue(ABMultiValue <string> multiProperty, int identifier)
        {
            nint i = multiProperty.GetIndexForIdentifier(identifier);

            string[] values = multiProperty.GetValues();
            return(values [(int)i]);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
		string GetValue(ABMultiValue<string> multiProperty, int identifier)
		{
			nint i = multiProperty.GetIndexForIdentifier (identifier);
			string[] values = multiProperty.GetValues ();
			return values [(int)i];
		}