You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Src/AsyncAwaitBestPractices.MVVM/AsyncValueCommand.cs
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ public class AsyncValueCommand<T> : IAsyncValueCommand<T>
24
24
/// <param name="onException">If an exception is thrown in the Task, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
25
25
/// <param name="continueOnCapturedContext">If set to <c>true</c> continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c> continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
26
26
publicAsyncValueCommand(Func<T,ValueTask>execute,
27
-
Func<object?,bool>?canExecute=null,
28
-
Action<Exception>?onException=null,
29
-
boolcontinueOnCapturedContext=false)
27
+
Func<object?,bool>?canExecute=null,
28
+
Action<Exception>?onException=null,
29
+
boolcontinueOnCapturedContext=false)
30
30
{
31
31
_execute=execute??thrownewArgumentNullException(nameof(execute),$"{nameof(execute)} cannot be null");
#pragma warning restore CS8604// Possible null reference argument.
77
77
@@ -103,9 +103,9 @@ public class AsyncValueCommand : IAsyncValueCommand
103
103
/// <param name="onException">If an exception is thrown in the Task, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
104
104
/// <param name="continueOnCapturedContext">If set to <c>true</c> continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c> continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
105
105
publicAsyncValueCommand(Func<ValueTask>execute,
106
-
Func<object?,bool>?canExecute=null,
107
-
Action<Exception>?onException=null,
108
-
boolcontinueOnCapturedContext=false)
106
+
Func<object?,bool>?canExecute=null,
107
+
Action<Exception>?onException=null,
108
+
boolcontinueOnCapturedContext=false)
109
109
{
110
110
_execute=execute??thrownewArgumentNullException(nameof(execute),$"{nameof(execute)} cannot be null");
111
111
_canExecute=canExecute??(_ =>true);
@@ -140,6 +140,6 @@ public event EventHandler CanExecuteChanged
/// Safely execute the ValueTask without waiting for it to complete before moving to the next line of code; commonly known as "Fire And Forget". Inspired by John Thiriet's blog post, "Removing Async Void": https://johnthiriet.com/removing-async-void/.
53
-
/// </summary>
54
-
/// <param name="task">ValueTask.</param>
55
-
/// <param name="continueOnCapturedContext">If set to <c>true</c>, continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c>, continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
56
-
/// <param name="onException">If an exception is thrown in the ValueTask, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
/// Safely execute the ValueTask without waiting for it to complete before moving to the next line of code; commonly known as "Fire And Forget". Inspired by John Thiriet's blog post, "Removing Async Void": https://johnthiriet.com/removing-async-void/.
63
-
/// </summary>
64
-
/// <param name="task">ValueTask.</param>
65
-
/// <param name="continueOnCapturedContext">If set to <c>true</c>, continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c>, continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
66
-
/// <param name="onException">If an exception is thrown in the Task, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
67
-
/// <typeparam name="TException">Exception type. If an exception is thrown of a different type, it will not be handled</typeparam>
/// Safely execute the Task without waiting for it to complete before moving to the next line of code; commonly known as "Fire And Forget". Inspired by John Thiriet's blog post, "Removing Async Void": https://johnthiriet.com/removing-async-void/.
74
-
/// </summary>
75
-
/// <param name="task">Task.</param>
76
-
/// <param name="continueOnCapturedContext">If set to <c>true</c>, continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c>, continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
77
-
/// <param name="onException">If an exception is thrown in the Task, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
/// Safely execute the Task without waiting for it to complete before moving to the next line of code; commonly known as "Fire And Forget". Inspired by John Thiriet's blog post, "Removing Async Void": https://johnthiriet.com/removing-async-void/.
83
-
/// </summary>
84
-
/// <param name="task">Task.</param>
85
-
/// <param name="continueOnCapturedContext">If set to <c>true</c>, continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c>, continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
86
-
/// <param name="onException">If an exception is thrown in the Task, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
87
-
/// <typeparam name="TException">Exception type. If an exception is thrown of a different type, it will not be handled</typeparam>
0 commit comments