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
<summary>Invokes the specified synchronous callback asynchronously on the thread that owns the control's handle.</summary>
8331
-
<returns>A task representing the operation.</returns>
8331
+
<returns>A task that represents the asynchronous invoke operation.</returns>
8332
8332
<remarks>
8333
8333
<para>
8334
-
<b>Note:</b> When you pass a <see cref="T:System.Threading.CancellationToken" /> to this method, the method will return, but the callback will still be executed.
8335
-
The callback will be running on the UI thread and will be also blocking the UI thread. InvokeAsync in this case is just queuing the callback to the end of the message queue and returns immediately,
8336
-
but as soon as the callback gets executed, it will still block the UI thread for the time it is running. For this reason, it is recommended to only execute short sync running operations in the callback, like updating a control's property or similar.
8334
+
When you pass a <see cref="T:System.Threading.CancellationToken" /> to this method, the method will return, but the callback will still be executed.
8335
+
The callback will be running on the UI thread and will be also blocking the UI thread. <c>InvokeAsync</c> in this case is just queuing the callback to the end of the message queue and returns immediately, but as soon as the callback gets executed, it will still block the UI thread for the time it is running. For this reason, it is recommended to only execute short sync running operations in the callback, like updating a control's property or similar.
8337
8336
</para>
8338
8337
<para>
8339
8338
If you want to execute a long-running operation, consider using asynchronous callbacks instead, by making sure that you use either the overload <see cref="M:System.Windows.Forms.Control.InvokeAsync(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask},System.Threading.CancellationToken)" />
@@ -8372,19 +8371,16 @@ MyControl.Font = New Font(MyControl.Font, _
<summary>Executes the specified asynchronous callback on the thread that owns the control's handle asynchronously.</summary>
8375
-
<returns>A task representing the operation.</returns>
8374
+
<returns>A task that represents the asynchronous invoke operation.</returns>
8376
8375
<remarks>
8377
8376
<para>
8378
-
<b>Note:</b> The callback will be marshalled to the thread that owns the control's handle, and then awaited. Exceptions will be propagated back to the caller. Also note that the returned task is not the task associated with the callback,
8379
-
but a task representing the operation of marshalling the callback to the UI thread. If you need to pass a callback returning a <see cref="T:System.Threading.Tasks.Task" /> rather than a <see cref="T:System.Threading.Tasks.ValueTask" />,
8380
-
use the ValueTask's constructor to create a new ValueTask which wraps the original Task. The <see cref="T:System.Threading.CancellationToken" /> will be both taken into account when marshalling the callback to the thread that owns the control's handle,
8381
-
and when executing the callback.
8377
+
The callback will be marshalled to the thread that owns the control's handle, and then awaited. Exceptions will be propagated back to the caller. Also note that the returned task is not the task associated with the callback, but a task representing the operation of marshalling the callback to the UI thread. If you need to pass a callback returning a <see cref="T:System.Threading.Tasks.Task" /> rather than a <see cref="T:System.Threading.Tasks.ValueTask" />, use the <see cref="M:System.Threading.Tasks.ValueTask.#ctor(System.Threading.Tasks.Task)" />'s constructor to create a new <see cref="T:System.Threading.Tasks.ValueTask" /> which wraps the original Task. The <see cref="T:System.Threading.CancellationToken" /> will be both taken into account when marshalling the callback to the thread that owns the control's handle, and when executing the callback.
8382
8378
</para>
8383
8379
<para>
8384
8380
If you want to asynchronously execute a synchronous callback, use the overload <see cref="M:System.Windows.Forms.Control.InvokeAsync``1(System.Func{``0},System.Threading.CancellationToken)" /> or the overload <see cref="M:System.Windows.Forms.Control.InvokeAsync(System.Action,System.Threading.CancellationToken)" />.
8385
8381
</para>
8386
8382
</remarks>
8387
-
<exception cref="T:System.InvalidOperationException">Thrown if the control's handle is not yet created.</exception>
8383
+
<exception cref="T:System.InvalidOperationException">The control's handle is not yet created.</exception>
8388
8384
</Docs>
8389
8385
</Member>
8390
8386
<Member MemberName="InvokeAsync<T>">
@@ -8435,17 +8431,17 @@ MyControl.Font = New Font(MyControl.Font, _
<summary>Executes the specified asynchronous callback on the thread that owns the control's handle.</summary>
8438
-
<returns>A task representing the operation and containing the function's result of type T.</returns>
8434
+
<returns>A task representing the operation and containing the function's result of type <typeparamref name="T" />.</returns>
8439
8435
<remarks>
8440
8436
<para>
8441
-
<b>Note:</b> The callback will be marshalled to the thread that owns the control's handle, and then be awaited. Exceptions will be propagated back to the caller. Also note that the returned task is not the task associated with the callback,
8442
-
but a task representing the operation of marshalling the callback to the UI thread. If you need to pass a callback returning a <see cref="T:System.Threading.Tasks.Task" /> rather than a <see cref="T:System.Threading.Tasks.ValueTask" />,
8443
-
use the ValueTask's constructor to create a new ValueTask which wraps the original Task. The <see cref="T:System.Threading.CancellationToken" /> will be both taken into account when marshalling the callback to the thread that owns the control's handle,
8437
+
The callback will be marshalled to the thread that owns the control's handle, and then be awaited. Exceptions will be propagated back to the caller. Also note that the returned task is not the task associated with the callback,
8438
+
but a task representing the operation of marshalling the callback to the UI thread. If you need to pass a callback returning a <see cref="T:System.Threading.Tasks.Task`1" /> rather than a <see cref="T:System.Threading.Tasks.ValueTask`1" />,
8439
+
use the <see cref="M:System.Threading.Tasks.ValueTask`1.#ctor(System.Threading.Tasks.Task{`0})" />'s constructor to create a new <see cref="T:System.Threading.Tasks.ValueTask`1" /> which wraps the original Task. The <see cref="T:System.Threading.CancellationToken" /> will be both taken into account when marshalling the callback to the thread that owns the control's handle,
8444
8440
and when executing the callback.
8445
8441
</para>
8446
8442
<para>If you want to asynchronously execute a synchronous callback, use the overload <see cref="M:System.Windows.Forms.Control.InvokeAsync``1(System.Func{``0},System.Threading.CancellationToken)" /> or the overload <see cref="M:System.Windows.Forms.Control.InvokeAsync(System.Action,System.Threading.CancellationToken)" />.</para>
8447
8443
</remarks>
8448
-
<exception cref="T:System.InvalidOperationException">Thrown if the control's handle is not yet created.</exception>
8444
+
<exception cref="T:System.InvalidOperationException">The control's handle is not yet created.</exception>
8449
8445
</Docs>
8450
8446
</Member>
8451
8447
<Member MemberName="InvokeAsync<T>">
@@ -8490,11 +8486,11 @@ MyControl.Font = New Font(MyControl.Font, _
8490
8486
<returns>A task representing the operation and containing the function's result.</returns>
8491
8487
<remarks>
8492
8488
<para>
8493
-
<b>Note:</b> When you pass a <see cref="T:System.Threading.CancellationToken" /> to this method, the method will return, but the callback will still be executed. The callback will be running on the UI thread and will be also blocking the UI thread.
8489
+
When you pass a <see cref="T:System.Threading.CancellationToken" /> to this method, the method will return, but the callback will still be executed. The callback will be running on the UI thread and will be also blocking the UI thread.
8494
8490
InvokeAsync in this case is just queuing the callback to the end of the message queue and returns immediately, but as soon as the callback is executed, it will still block the UI for the time it is running. For this reason, it is recommended to only
8495
8491
execute short sync running operations in the callback, like updating a control's property or similar.
8496
8492
</para>
8497
-
<para>If you want to execute a long-running operation, consider using asynchronous callbacks instead, which you use with the overloads of InvokeAsync described below.</para>
8493
+
<para>If you want to execute a long-running operation, consider using asynchronous callbacks instead, which you use with the overloads of <c>InvokeAsync</c> described below.</para>
8498
8494
<para>
8499
8495
<b>Important:</b> Also note that if you use this overload to pass a callback which returns a <see cref="T:System.Threading.Tasks.Task" /> that this Task will NOT be awaited but return immediately and has the characteristics of an "engage-and-forget".
8500
8496
If you want the task which you pass to be awaited, make sure that you use either the overload <see cref="M:System.Windows.Forms.Control.InvokeAsync(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask},System.Threading.CancellationToken)" />
@@ -17893,9 +17889,7 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
17893
17889
<param name="deviceDpiOld">The DPI value prior to the change.</param>
17894
17890
<param name="deviceDpiNew">The DPI value after the change.</param>
17895
17891
<summary>Provides constants for rescaling the control when a DPI change occurs.</summary>
17896
-
<remarks>
17897
-
<para>This method is an opportunity to rescale any constant sizes, glyphs or bitmaps before re-painting.</para>
17898
-
</remarks>
17892
+
<remarks>This method is an opportunity to rescale any constant sizes, glyphs or bitmaps before re-painting.</remarks>
0 commit comments