Exemplo n.º 1
0
        /// <summary>
        /// Delete a contact from the device.
        /// </summary>
        /// <param name="id">Contact's id.</param>
        /// <returns>Error, null if the contact has been deleted successfully.</returns>
        public static string DeleteContact(string id)
        {
            if (id == null)
            {
                return(InvalidContactIdMessage);
            }

            return(NativeProvider.DeleteContact(id));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add new contact into the device.
        /// </summary>
        /// <param name="contact">Contact's info. Note that the "id" field will be ignored.</param>
        /// <returns>Error, null if the contact has been added successfully.</returns>
        public static string AddContact(Contact contact)
        {
            if (contact == null)
            {
                return(InvalidContactMessage);
            }

            return(NativeProvider.AddContact(contact));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get all the contacts in the devices.
        /// </summary>
        /// <param name="callback">
        /// Param 1: Error, null means success.
        /// Param 2: All contacts on the device, null if there's an error.
        /// </param>
        public static void GetContacts(Action <string, Contact[]> callback)
        {
            if (callback == null)
            {
                return;
            }

            if (NativeProvider == null)
            {
                callback(NullContactsProviderMessage, null);
                return;
            }

            NativeProvider.GetContacts(callback);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Open native UI to pick up contacts.
 /// </summary>        /// <param name="callback">
 /// Param 1: Error, null if success.
 /// Param 2: All selected contacts.
 ///</param>
 public static void PickContact(Action <string, Contact> callback)
 {
     NativeProvider.PickContact(callback);
 }