From 906a663e6c3d422bebee978b1bba647a89eb096f Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Wed, 16 Nov 2022 16:29:58 +0100 Subject: [PATCH 1/2] Update Essentials Contacts API Docs --- .../Microsoft.Maui.Essentials/Contacts.xml | 60 ------------------- .../Contacts.netstandard.tvos.watchos.cs | 1 - .../src/Contacts/Contacts.shared.cs | 30 +++++++++- 3 files changed, 27 insertions(+), 64 deletions(-) delete mode 100644 src/Essentials/docs/Microsoft.Maui.Essentials/Contacts.xml diff --git a/src/Essentials/docs/Microsoft.Maui.Essentials/Contacts.xml b/src/Essentials/docs/Microsoft.Maui.Essentials/Contacts.xml deleted file mode 100644 index 8108620ce158..000000000000 --- a/src/Essentials/docs/Microsoft.Maui.Essentials/Contacts.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - Microsoft.Maui.Essentials - 1.0.0.0 - - - System.Object - - - - API class for working with contacts on the device. - - - - - - - - Method - - Microsoft.Maui.Essentials - 1.0.0.0 - - - System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Maui.ApplicationModel.Communication.Contact>> - - - - - - A token for cancelling the operation - Gets a collection of all the contacts on the device. - Returns a collection of contacts on the device. - - - - - - - - Method - - Microsoft.Maui.Essentials - 1.0.0.0 - - - System.Threading.Tasks.Task<Microsoft.Maui.ApplicationModel.Communication.Contact> - - - - Starts file picker for selecting a single contact. - Returns a single contact, or null if the user cancelled the operation. - - - - - diff --git a/src/Essentials/src/Contacts/Contacts.netstandard.tvos.watchos.cs b/src/Essentials/src/Contacts/Contacts.netstandard.tvos.watchos.cs index 99db6fb3b68e..8dbc3836d5ba 100644 --- a/src/Essentials/src/Contacts/Contacts.netstandard.tvos.watchos.cs +++ b/src/Essentials/src/Contacts/Contacts.netstandard.tvos.watchos.cs @@ -4,7 +4,6 @@ namespace Microsoft.Maui.ApplicationModel.Communication { - /// class ContactsImplementation : IContacts { public Task PickContactAsync() => diff --git a/src/Essentials/src/Contacts/Contacts.shared.cs b/src/Essentials/src/Contacts/Contacts.shared.cs index 161cfb817f02..57be0509ffed 100644 --- a/src/Essentials/src/Contacts/Contacts.shared.cs +++ b/src/Essentials/src/Contacts/Contacts.shared.cs @@ -5,26 +5,50 @@ namespace Microsoft.Maui.ApplicationModel.Communication { + /// + /// The Contacts APIs lets a user pick a contact and retrieve information about it. + /// public interface IContacts { + /// + /// Opens the operating system's default UI for picking a contact from the device. + /// + /// A single contact, or if the user cancelled the operation. Task PickContactAsync(); + /// + /// Gets a collection of all the contacts on the device. + /// + /// A token that can be used for cancelling the operation. + /// A collection of contacts on the device. Task> GetAllAsync(CancellationToken cancellationToken = default); } - /// + /// + /// The Contacts APIs lets a user pick a contact and retrieve information about it. + /// public static class Contacts { - /// + /// + /// Opens the operating system's default UI for picking a contact from the device. + /// + /// A single contact, or if the user cancelled the operation. public static Task PickContactAsync() => Default.PickContactAsync(); - /// + /// + /// Gets a collection of all the contacts on the device. + /// + /// A token that can be used for cancelling the operation. + /// A collection of contacts on the device. public static Task> GetAllAsync(CancellationToken cancellationToken = default) => Default.GetAllAsync(cancellationToken); static IContacts? defaultImplementation; + /// + /// Provides the default implementation for static usage of this API. + /// public static IContacts Default => defaultImplementation ??= new ContactsImplementation(); From 0a9df775e7f8024d8125c95deaf8fe46c785645b Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Thu, 17 Nov 2022 09:40:31 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: E.Z. Hart --- src/Essentials/src/Contacts/Contacts.shared.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Essentials/src/Contacts/Contacts.shared.cs b/src/Essentials/src/Contacts/Contacts.shared.cs index 57be0509ffed..42ba47ab7077 100644 --- a/src/Essentials/src/Contacts/Contacts.shared.cs +++ b/src/Essentials/src/Contacts/Contacts.shared.cs @@ -6,7 +6,7 @@ namespace Microsoft.Maui.ApplicationModel.Communication { /// - /// The Contacts APIs lets a user pick a contact and retrieve information about it. + /// The Contacts API lets a user pick a contact and retrieve information about it. /// public interface IContacts { @@ -25,7 +25,7 @@ public interface IContacts } /// - /// The Contacts APIs lets a user pick a contact and retrieve information about it. + /// The Contacts API lets a user pick a contact and retrieve information about it. /// public static class Contacts {