From 7dcce8a6e1561eb47c2c453ca4b0a821bcf0f472 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 3 Feb 2020 14:51:51 +0100 Subject: [PATCH] Improved XML comments --- .../Helpers/DispatcherHelper.cs | 128 ++++++++++-------- 1 file changed, 69 insertions(+), 59 deletions(-) diff --git a/Microsoft.Toolkit.Uwp/Helpers/DispatcherHelper.cs b/Microsoft.Toolkit.Uwp/Helpers/DispatcherHelper.cs index 5500fcbbe1e..ee309ae1cc2 100644 --- a/Microsoft.Toolkit.Uwp/Helpers/DispatcherHelper.cs +++ b/Microsoft.Toolkit.Uwp/Helpers/DispatcherHelper.cs @@ -15,23 +15,25 @@ namespace Microsoft.Toolkit.Uwp.Helpers public static class DispatcherHelper { /// - /// Executes the given function asynchronously on given view's UI thread. Default view is the main view. + /// Executes the given function on a given view's UI thread. The default view is the main view. /// - /// Asynchronous function to be executed asynchronously on UI thread - /// Dispatcher execution priority, default is normal - /// Awaitable Task/> + /// Synchronous function to be executed on UI thread. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task ExecuteOnUIThreadAsync(Action function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { return ExecuteOnUIThreadAsync(CoreApplication.MainView, function, priority); } /// - /// Executes the given function asynchronously on given view's UI thread. Default view is the main view. + /// Executes the given function on a given view's UI thread. The default view is the main view. /// - /// Returned data type of the function - /// Synchronous function to be executed on UI thread - /// Dispatcher execution priority, default is normal - /// Awaitable Task + /// Returned data type of the function. + /// Synchronous function to be executed on UI thread. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task ExecuteOnUIThreadAsync(Func function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { return ExecuteOnUIThreadAsync(CoreApplication.MainView, function, priority); @@ -40,9 +42,9 @@ public static Task ExecuteOnUIThreadAsync(Func function, CoreDispatcher /// /// Executes the given function asynchronously on UI thread of the main view. /// - /// Asynchronous function to be executed asynchronously on UI thread - /// Dispatcher execution priority, default is normal - /// Awaitable Task + /// Asynchronous function to be executed asynchronously on UI thread. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. public static Task ExecuteOnUIThreadAsync(Func function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { return ExecuteOnUIThreadAsync(CoreApplication.MainView, function, priority); @@ -51,22 +53,23 @@ public static Task ExecuteOnUIThreadAsync(Func function, CoreDispatcherPri /// /// Executes the given function asynchronously on UI thread of the main view. /// - /// Returned data type of the function - /// Asynchronous function to be executed asynchronously on UI thread - /// Dispatcher execution priority, default is normal - /// Awaitable Task with type + /// Returned data type of the function. + /// Asynchronous function to be executed asynchronously on UI thread. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. public static Task ExecuteOnUIThreadAsync(Func> function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { return ExecuteOnUIThreadAsync(CoreApplication.MainView, function, priority); } /// - /// Executes the given function asynchronously on given view's UI thread. Default view is the main view. + /// Executes the given function on a given view's UI thread. /// - /// View for the to be executed on - /// Asynchronous function to be executed asynchronously on UI thread + /// View for the to be executed on. + /// Synchronous function to be executed on UI thread. /// Dispatcher execution priority, default is normal - /// Awaitable Task/> + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task ExecuteOnUIThreadAsync(this CoreApplicationView viewToExecuteOn, Action function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { if (viewToExecuteOn is null) @@ -78,13 +81,14 @@ public static Task ExecuteOnUIThreadAsync(this CoreApplicationView viewToExecute } /// - /// Executes the given function asynchronously on given view's UI thread. Default view is the main view. + /// Executes the given function on a given view's UI thread. /// - /// Returned data type of the function - /// View for the to be executed on - /// Synchronous function with return type to be executed on UI thread - /// Dispatcher execution priority, default is normal - /// Awaitable Task with type + /// Returned data type of the function. + /// View for the to be executed on. + /// Synchronous function with return type to be executed on UI thread. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task ExecuteOnUIThreadAsync(this CoreApplicationView viewToExecuteOn, Func function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { if (viewToExecuteOn is null) @@ -96,12 +100,13 @@ public static Task ExecuteOnUIThreadAsync(this CoreApplicationView viewToE } /// - /// Executes the given function asynchronously on given view's UI thread. Default view is the main view. + /// Executes the given function on a given view's UI thread. /// - /// View for the to be executed on - /// Asynchronous function to be executed asynchronously on UI thread - /// Dispatcher execution priority, default is normal - /// Awaitable Task + /// View for the to be executed on. + /// Asynchronous function to be executed asynchronously on UI thread. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task ExecuteOnUIThreadAsync(this CoreApplicationView viewToExecuteOn, Func function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { if (viewToExecuteOn is null) @@ -113,13 +118,14 @@ public static Task ExecuteOnUIThreadAsync(this CoreApplicationView viewToExecute } /// - /// Executes the given function asynchronously on given view's UI thread. Default view is the main view. + /// Executes the given function on a given view's UI thread. /// - /// Returned data type of the function - /// View for the to be executed on - /// Asynchronous function to be executed asynchronously on UI thread - /// Dispatcher execution priority, default is normal - /// Awaitable Task with type + /// Returned data type of the function. + /// View for the to be executed on. + /// Asynchronous function to be executed asynchronously on UI thread. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task ExecuteOnUIThreadAsync(this CoreApplicationView viewToExecuteOn, Func> function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { if (viewToExecuteOn is null) @@ -131,12 +137,13 @@ public static Task ExecuteOnUIThreadAsync(this CoreApplicationView viewToE } /// - /// Extension method for CoreDispatcher. Offering an actual awaitable Task with optional result that will be executed on the given dispatcher + /// Extension method for . Offering an actual awaitable with optional result that will be executed on the given dispatcher. /// - /// Dispatcher of a thread to run - /// Function to be executed asynchrounously on the given dispatcher - /// Dispatcher execution priority, default is normal - /// Awaitable Task + /// Dispatcher of a thread to run . + /// Function to be executed on the given dispatcher. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task AwaitableRunAsync(this CoreDispatcher dispatcher, Action function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { if (function is null) @@ -181,13 +188,14 @@ public static Task AwaitableRunAsync(this CoreDispatcher dispatcher, Action func } /// - /// Extension method for CoreDispatcher. Offering an actual awaitable Task with optional result that will be executed on the given dispatcher + /// Extension method for . Offering an actual awaitable with optional result that will be executed on the given dispatcher. /// - /// Returned data type of the function - /// Dispatcher of a thread to run - /// Function to be executed asynchrounously on the given dispatcher - /// Dispatcher execution priority, default is normal - /// Awaitable Task + /// Returned data type of the function. + /// Dispatcher of a thread to run . + /// Function to be executed on the given dispatcher. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task AwaitableRunAsync(this CoreDispatcher dispatcher, Func function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { if (function is null) @@ -226,12 +234,13 @@ public static Task AwaitableRunAsync(this CoreDispatcher dispatcher, Func< } /// - /// Extension method for CoreDispatcher. Offering an actual awaitable Task with optional result that will be executed on the given dispatcher + /// Extension method for . Offering an actual awaitable with optional result that will be executed on the given dispatcher. /// - /// Dispatcher of a thread to run - /// Asynchrounous function to be executed asynchrounously on the given dispatcher - /// Dispatcher execution priority, default is normal - /// Awaitable Task + /// Dispatcher of a thread to run . + /// Asynchrounous function to be executed on the given dispatcher. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task AwaitableRunAsync(this CoreDispatcher dispatcher, Func function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { if (function is null) @@ -287,13 +296,14 @@ public static Task AwaitableRunAsync(this CoreDispatcher dispatcher, Func } /// - /// Extension method for CoreDispatcher. Offering an actual awaitable Task with optional result that will be executed on the given dispatcher + /// Extension method for . Offering an actual awaitable with optional result that will be executed on the given dispatcher. /// - /// Returned data type of the function - /// Dispatcher of a thread to run - /// Asynchrounous function to be executed asynchrounously on the given dispatcher - /// Dispatcher execution priority, default is normal - /// Awaitable Task with type + /// Returned data type of the function. + /// Dispatcher of a thread to run . + /// Asynchrounous function to be executed asynchrounously on the given dispatcher. + /// Dispatcher execution priority, default is normal. + /// An awaitable for the operation. + /// If the current thread has UI access, will be invoked directly. public static Task AwaitableRunAsync(this CoreDispatcher dispatcher, Func> function, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) { if (function is null)