Skip to content

Commit 927aeb8

Browse files
committed
PR feedback
1 parent 6ba3897 commit 927aeb8

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

xml/System.Windows.Forms/Control.xml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8328,12 +8328,11 @@ MyControl.Font = New Font(MyControl.Font, _
83288328
<param name="callback">The synchronous action to execute.</param>
83298329
<param name="cancellationToken">The cancellation token.</param>
83308330
<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>
83328332
<remarks>
83338333
<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.
83378336
</para>
83388337
<para>
83398338
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, _
83728371
</param>
83738372
<param name="cancellationToken">The cancellation token.</param>
83748373
<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>
83768375
<remarks>
83778376
<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.
83828378
</para>
83838379
<para>
83848380
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)" />.
83858381
</para>
83868382
</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>
83888384
</Docs>
83898385
</Member>
83908386
<Member MemberName="InvokeAsync&lt;T&gt;">
@@ -8435,17 +8431,17 @@ MyControl.Font = New Font(MyControl.Font, _
84358431
</param>
84368432
<param name="cancellationToken">The cancellation token.</param>
84378433
<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>
84398435
<remarks>
84408436
<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,
84448440
and when executing the callback.
84458441
</para>
84468442
<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>
84478443
</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>
84498445
</Docs>
84508446
</Member>
84518447
<Member MemberName="InvokeAsync&lt;T&gt;">
@@ -8490,11 +8486,11 @@ MyControl.Font = New Font(MyControl.Font, _
84908486
<returns>A task representing the operation and containing the function's result.</returns>
84918487
<remarks>
84928488
<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.
84948490
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
84958491
execute short sync running operations in the callback, like updating a control's property or similar.
84968492
</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>
84988494
<para>
84998495
<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".
85008496
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) {
1789317889
<param name="deviceDpiOld">The DPI value prior to the change.</param>
1789417890
<param name="deviceDpiNew">The DPI value after the change.</param>
1789517891
<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>
1789917893
</Docs>
1790017894
</Member>
1790117895
<Member MemberName="ResetBackColor">

0 commit comments

Comments
 (0)