예제 #1
0
        /// <summary>
        /// Deletes a contact. Called by ContactListPage.
        /// </summary>
        /// <param name="id">Id of the contact to delete.</param>
        public void DeleteContact(string id)
        {
            #if PLATFORM_LUMIN
            ulong requestHandle = 0;

            if (!string.IsNullOrEmpty(id) && loadedContacts.ContainsKey(id))
            {
                MLResult result = MLContacts.DeleteContact(loadedContacts[id], out requestHandle);
                if (!result.IsOk)
                {
                    Debug.LogErrorFormat("Error: MLContactsBehavior failed to delete contact. Reason: {0}", result);
                }
            }
            else
            {
                Debug.LogErrorFormat("Error: MLContactsBehavior failed to delete contact. Reason: Invalid ID {0}", id);
            }
            #endif
        }
예제 #2
0
        /// <summary>
        /// Deletes a contact. Called by ContactListPage.
        /// </summary>
        /// <param name="id">ID of the Contact</param>
        public void DeleteContact(string id)
        {
            Log("Deleting contact");

            ulong requestHandle = 0;

            if (!string.IsNullOrEmpty(id) && _loadedContacts.ContainsKey(id))
            {
                MLResult result = MLContacts.DeleteContact(_loadedContacts[id], out requestHandle);
                if (!result.IsOk)
                {
                    Debug.LogErrorFormat("Error: ContactsExample failed to delete contact. Reason: {0}", result);
                    Log(string.Format("<color=red>Failed to delete contact. {0}</color>", result));
                }
            }
            else
            {
                Debug.LogErrorFormat("Error: ContactsExample failed to delete contact. Reason: Invalid ID {0}", id);
                Log("<color=red>Failed to delete contact.</color>");
            }
        }