public override bool ShouldPerformDefaultActionForPerson (ABPersonViewController personViewController, ABPerson person, int propertyId, int identifier) { ABPersonProperty property = ABPersonPropertyId.ToPersonProperty (propertyId); int? id = identifier == ABRecord.InvalidPropertyId ? null : (int?) identifier; var e = new ABPersonViewPerformDefaultActionEventArgs (person, property, id); personViewController.OnPerformDefaultAction (e); return e.ShouldPerformDefaultAction; }
public override void DidSelectPerson(ABPeoplePickerNavigationController peoplePicker, ABPerson selectedPerson, int propertyId, int identifier) { ABPersonProperty property = ABPersonPropertyId.ToPersonProperty(propertyId); int?id = identifier == ABRecord.InvalidPropertyId ? null : (int?)identifier; var e = new ABPeoplePickerPerformAction2EventArgs(selectedPerson, property, id); peoplePicker.OnPerformAction2(e); }
public static int ToId(ABPersonProperty property) { switch (property) { case ABPersonProperty.Address: return(Address); case ABPersonProperty.Birthday: return(Birthday); case ABPersonProperty.CreationDate: return(CreationDate); case ABPersonProperty.Date: return(Date); case ABPersonProperty.Department: return(Department); case ABPersonProperty.Email: return(Email); case ABPersonProperty.FirstName: return(FirstName); case ABPersonProperty.FirstNamePhonetic: return(FirstNamePhonetic); case ABPersonProperty.InstantMessage: return(InstantMessage); case ABPersonProperty.JobTitle: return(JobTitle); case ABPersonProperty.Kind: return(Kind); case ABPersonProperty.LastName: return(LastName); case ABPersonProperty.LastNamePhonetic: return(LastNamePhonetic); case ABPersonProperty.MiddleName: return(MiddleName); case ABPersonProperty.MiddleNamePhonetic: return(MiddleNamePhonetic); case ABPersonProperty.ModificationDate: return(ModificationDate); case ABPersonProperty.Nickname: return(Nickname); case ABPersonProperty.Note: return(Note); case ABPersonProperty.Organization: return(Organization); case ABPersonProperty.Phone: return(Phone); case ABPersonProperty.Prefix: return(Prefix); case ABPersonProperty.RelatedNames: return(RelatedNames); case ABPersonProperty.Suffix: return(Suffix); case ABPersonProperty.Url: return(Url); case ABPersonProperty.SocialProfile: return(SocialProfile); } throw new NotSupportedException("Invalid ABPersonProperty value: " + property); }
public object GetProperty(ABPersonProperty property) { switch (property) { case ABPersonProperty.Address: return(GetAllAddresses()); case ABPersonProperty.Birthday: return(Birthday); case ABPersonProperty.CreationDate: return(CreationDate); case ABPersonProperty.Date: return(GetDates()); case ABPersonProperty.Department: return(Department); case ABPersonProperty.Email: return(GetEmails()); case ABPersonProperty.FirstName: return(FirstName); case ABPersonProperty.FirstNamePhonetic: return(FirstNamePhonetic); case ABPersonProperty.InstantMessage: return(GetInstantMessages()); case ABPersonProperty.JobTitle: return(JobTitle); case ABPersonProperty.Kind: return(PersonKind); case ABPersonProperty.LastName: return(LastName); case ABPersonProperty.LastNamePhonetic: return(LastNamePhonetic); case ABPersonProperty.MiddleName: return(MiddleName); case ABPersonProperty.MiddleNamePhonetic: return(MiddleNamePhonetic); case ABPersonProperty.ModificationDate: return(ModificationDate); case ABPersonProperty.Nickname: return(Nickname); case ABPersonProperty.Note: return(Note); case ABPersonProperty.Organization: return(Organization); case ABPersonProperty.Phone: return(GetPhones()); case ABPersonProperty.Prefix: return(Prefix); case ABPersonProperty.RelatedNames: return(GetRelatedNames()); case ABPersonProperty.Suffix: return(Suffix); case ABPersonProperty.Url: return(GetUrls()); case ABPersonProperty.SocialProfile: return(GetSocialProfile()); } throw new ArgumentException("Invalid property value: " + property); }
public override bool ShouldContinue(ABPeoplePickerNavigationController peoplePicker, IntPtr selectedPerson, int propertyId, int identifier) { ABPerson person = selectedPerson == IntPtr.Zero ? null : new ABPerson(selectedPerson, peoplePicker.AddressBook); ABPersonProperty property = ABPersonPropertyId.ToPersonProperty(propertyId); int?id = identifier == ABRecord.InvalidPropertyId ? null : (int?)identifier; var e = new ABPeoplePickerPerformActionEventArgs(person, property, id); peoplePicker.OnPerformAction(e); return(e.Continue); }
public override bool ShouldPerformDefaultActionForPerson(ABUnknownPersonViewController personViewController, IntPtr personId, int propertyId, int identifier) { ABPerson person = personId == IntPtr.Zero ? null : new ABPerson(personId, personViewController.AddressBook); #endif ABPersonProperty property = ABPersonPropertyId.ToPersonProperty(propertyId); int?id = identifier == ABRecord.InvalidPropertyId ? null : (int?)identifier; var e = new ABPersonViewPerformDefaultActionEventArgs(person, property, id); personViewController.OnPerformDefaultAction(e); return(e.ShouldPerformDefaultAction); }
string GetPropertyValue(ABPerson person, ABPersonProperty property, int?identifier) { switch (property) { case ABPersonProperty.Birthday: return(person.Birthday.ToString()); case ABPersonProperty.Email: return(GetEmail(person, identifier.Value)); case ABPersonProperty.Phone: return(GetPhone(person, identifier.Value)); default: throw new NotImplementedException(); } }
public ABPeoplePickerPerformAction2EventArgs(ABPerson person, ABPersonProperty property, int?identifier) : base(person) { Property = property; Identifier = identifier; }
public ABPersonViewPerformDefaultActionEventArgs (ABPerson person, ABPersonProperty property, int? identifier) { Person = person; Property = property; Identifier = identifier; }
public ABPersonViewPerformDefaultActionEventArgs (ABPerson person, ABPersonProperty property, int? identifier) { Person = person; Property = property; Identifier = identifier; }
public void SetHighlightedProperty (ABPersonProperty property) { SetHighlightedItemForProperty ( ABPersonPropertyId.ToId (property), ABRecord.InvalidPropertyId); }
public void SetHighlightedItemForProperty (ABPersonProperty property, int? identifier) { SetHighlightedItemForProperty ( ABPersonPropertyId.ToId (property), identifier ?? ABRecord.InvalidPropertyId); }
string GetPropertyValue(ABPerson person, ABPersonProperty property, int? identifier) { switch (property) { case ABPersonProperty.Birthday: return person.Birthday.ToString (); case ABPersonProperty.Email: return GetEmail (person, identifier.Value); case ABPersonProperty.Phone: return GetPhone (person, identifier.Value); default: throw new NotImplementedException (); } }
public void SetHighlightedItemForProperty (ABPersonProperty property, int? identifier) { SetHighlightedItemForProperty ( ABPersonPropertyId.ToId (property), identifier.HasValue ? identifier.Value : ABRecord.InvalidPropertyId); }
public static string LocalizedPropertyName(ABPersonProperty property) { return(Runtime.GetNSObject(ABPersonCopyLocalizedPropertyName(ABPersonPropertyId.ToId(property))).ToString()); }
public static ABPropertyType GetPropertyType(ABPersonProperty property) { return(ABPersonGetTypeOfProperty(ABPersonPropertyId.ToId(property))); }
public void SetHighlightedProperty (ABPersonProperty property) { SetHighlightedItemForProperty ( ABPersonPropertyId.ToId (property), ABRecord.InvalidPropertyId); }