Skip to content

Commit

Permalink
XML formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausLoeffelmann committed Aug 11, 2024
1 parent 36e5c27 commit 4c997a8
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,25 +299,25 @@ private static TaskDialogButton CreatePlaceholderButton(TaskDialogResult result)
}

/// <summary>
/// Shows the task dialog with the specified owner asynchronously.
/// Shows the task dialog with the specified owner asynchronously.
/// </summary>
/// <param name="page">
/// The page instance that contains the contents which this task dialog will display.
/// The page instance that contains the contents which this task dialog will display.
/// </param>
/// <param name="startupLocation">
/// Gets or sets the position of the task dialog when it is shown.
/// Gets or sets the position of the task dialog when it is shown.
/// </param>
/// <remarks>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// </remarks>
/// <returns>
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="page"/> is <see langword="null"/>.
/// <paramref name="page"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
/// The specified <paramref name="page"/> contains an invalid configuration.
Expand All @@ -329,28 +329,28 @@ public static Task<TaskDialogButton> ShowDialogAsync(
=> ShowDialogAsync(IntPtr.Zero, page.OrThrowIfNull(), startupLocation);

/// <summary>
/// Shows the task dialog with the specified owner asynchronously.
/// Shows the task dialog with the specified owner asynchronously.
/// </summary>
/// <param name="page">
/// The page instance that contains the contents which this task dialog will display.
/// The page instance that contains the contents which this task dialog will display.
/// </param>
/// <param name="owner">
/// The owner window.
/// The owner window.
/// </param>
/// <param name="startupLocation">
/// Gets or sets the position of the task dialog when it is shown.
/// Gets or sets the position of the task dialog when it is shown.
/// </param>
/// <remarks>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// </remarks>
/// <returns>
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="page"/> is <see langword="null"/>.
/// <paramref name="page"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
/// The specified <paramref name="page"/> contains an invalid configuration.
Expand All @@ -363,28 +363,28 @@ public static Task<TaskDialogButton> ShowDialogAsync(
ShowDialogAsync(owner.Handle, page, startupLocation);

/// <summary>
/// Shows the task dialog with the specified owner asynchronously.
/// Shows the task dialog with the specified owner asynchronously.
/// </summary>
/// <param name="page">
/// The page instance that contains the contents which this task dialog will display.
/// The page instance that contains the contents which this task dialog will display.
/// </param>
/// <param name="hwndOwner">
/// The handle of the owner window, or <see cref="IntPtr.Zero"/> to show a modeless dialog.
/// The handle of the owner window, or <see cref="IntPtr.Zero"/> to show a modeless dialog.
/// </param>
/// <param name="startupLocation">
/// Gets or sets the position of the task dialog when it is shown.
/// Gets or sets the position of the task dialog when it is shown.
/// </param>
/// <remarks>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// </remarks>
/// <returns>
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="page"/> is <see langword="null"/>.
/// <paramref name="page"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
/// The specified <paramref name="page"/> contains an invalid configuration.
Expand Down Expand Up @@ -431,60 +431,60 @@ void ShowDialogProc()
}

/// <summary>
/// Shows the task dialog.
/// Shows the task dialog.
/// </summary>
/// <param name="page">
/// The page instance that contains the contents which this task dialog will display.
/// The page instance that contains the contents which this task dialog will display.
/// </param>
/// <param name="startupLocation">
/// Gets or sets the position of the task dialog when it is shown.
/// Gets or sets the position of the task dialog when it is shown.
/// </param>
/// <remarks>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// </remarks>
/// <returns>
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="page"/> is <see langword="null"/>.
/// <paramref name="page"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
/// The specified <paramref name="page"/> contains an invalid configuration.
/// The specified <paramref name="page"/> contains an invalid configuration.
/// </exception>
public static TaskDialogButton ShowDialog(
TaskDialogPage page,
TaskDialogStartupLocation startupLocation = TaskDialogStartupLocation.CenterOwner)
=> ShowDialog(IntPtr.Zero, page.OrThrowIfNull(), startupLocation);

/// <summary>
/// Shows the task dialog with the specified owner.
/// Shows the task dialog with the specified owner.
/// </summary>
/// <param name="page">
/// The page instance that contains the contents which this task dialog will display.
/// The page instance that contains the contents which this task dialog will display.
/// </param>
/// <param name="owner">The owner window, or <see langword="null"/> to show a modeless dialog.</param>
/// <param name="startupLocation">
/// Gets or sets the position of the task dialog when it is shown.
/// Gets or sets the position of the task dialog when it is shown.
/// </param>
/// <remarks>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// <para>
/// Showing the dialog will bind the <paramref name="page"/> and its controls until
/// this method returns or the dialog is navigated to a different page.
/// </para>
/// </remarks>
/// <returns>
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// The <see cref="TaskDialogButton"/> which was clicked by the user to close the dialog.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="owner"/> is <see langword="null"/>
/// - or -
/// <paramref name="page"/> is <see langword="null"/>.
/// <paramref name="owner"/> is <see langword="null"/>
/// - or -
/// <paramref name="page"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
/// The specified <paramref name="page"/> contains an invalid configuration.
/// The specified <paramref name="page"/> contains an invalid configuration.
/// </exception>
public static TaskDialogButton ShowDialog(
IWin32Window owner,
Expand Down
40 changes: 20 additions & 20 deletions src/System.Windows.Forms/src/System/Windows/Forms/Form.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5307,9 +5307,9 @@ public void Show(IWin32Window? owner)
/// <item><description>The form is not a top-level form.</description></item>
/// <item><description>The form is trying to set itself as its own owner.</description></item>
/// <item><description>
/// Thrown if the form is already displayed asynchronously or if no
/// <see cref="WindowsFormsSynchronizationContext"/> could be retrieved or installed.
/// </description></item>
/// Thrown if the form is already displayed asynchronously or if no
/// <see cref="WindowsFormsSynchronizationContext"/> could be retrieved or installed.
/// </description></item>
/// <item><description>The operating system is in a non-interactive mode.</description></item>
/// </list>
/// </exception>
Expand Down Expand Up @@ -5560,22 +5560,22 @@ public DialogResult ShowDialog(IWin32Window? owner)
/// </returns>
/// <remarks>
/// <para>
/// The task will complete when the form is closed or disposed.
/// The task will complete when the form is closed or disposed.
/// </para>
/// <para>
/// This method immediately returns, even if the form is large and takes a long time to be set up.
/// This method immediately returns, even if the form is large and takes a long time to be set up.
/// </para>
/// <para>
/// If the form is already displayed asynchronously by <see cref="Form.ShowAsync"/>, an <see cref="InvalidOperationException"/> will be thrown.
/// If the form is already displayed asynchronously by <see cref="Form.ShowAsync"/>, an <see cref="InvalidOperationException"/> will be thrown.
/// </para>
/// <para>
/// An <see cref="InvalidOperationException"/> will also occur if no <see cref="WindowsFormsSynchronizationContext"/> could be retrieved or installed.
/// An <see cref="InvalidOperationException"/> will also occur if no <see cref="WindowsFormsSynchronizationContext"/> could be retrieved or installed.
/// </para>
/// <para>
/// There is no need to marshal the call to the UI thread manually if the call originates from a different thread. This is handled automatically.
/// There is no need to marshal the call to the UI thread manually if the call originates from a different thread. This is handled automatically.
/// </para>
/// <para>
/// Any exceptions that occur will be automatically propagated to the calling thread.
/// Any exceptions that occur will be automatically propagated to the calling thread.
/// </para>
/// </remarks>
/// <exception cref="InvalidOperationException">
Expand All @@ -5595,22 +5595,22 @@ public DialogResult ShowDialog(IWin32Window? owner)
/// </returns>
/// <remarks>
/// <para>
/// The task will complete when the form is closed or disposed.
/// The task will complete when the form is closed or disposed.
/// </para>
/// <para>
/// This method immediately returns, even if the form is large and takes a long time to be set up.
/// This method immediately returns, even if the form is large and takes a long time to be set up.
/// </para>
/// <para>
/// If the form is already displayed asynchronously by <see cref="Form.ShowAsync"/>, an <see cref="InvalidOperationException"/> will be thrown.
/// If the form is already displayed asynchronously by <see cref="Form.ShowAsync"/>, an <see cref="InvalidOperationException"/> will be thrown.
/// </para>
/// <para>
/// An <see cref="InvalidOperationException"/> will also occur if no <see cref="WindowsFormsSynchronizationContext"/> could be retrieved or installed.
/// An <see cref="InvalidOperationException"/> will also occur if no <see cref="WindowsFormsSynchronizationContext"/> could be retrieved or installed.
/// </para>
/// <para>
/// There is no need to marshal the call to the UI thread manually if the call originates from a different thread. This is handled automatically.
/// There is no need to marshal the call to the UI thread manually if the call originates from a different thread. This is handled automatically.
/// </para>
/// <para>
/// Any exceptions that occur will be automatically propagated to the calling thread.
/// Any exceptions that occur will be automatically propagated to the calling thread.
/// </para>
/// </remarks>
/// <exception cref="InvalidOperationException">
Expand Down Expand Up @@ -5640,25 +5640,25 @@ private Task<DialogResult> ShowDialogAsyncInternal(IWin32Window? owner)
?? throw new InvalidOperationException(SR.FormOrTaskDialog_NoSyncContextForShowAsync);

syncContext.Post((state) => ShowDialogProc(
tcsModalForm: ref _modalFormCompletion, owner: owner),
modalFormCompletion: ref _modalFormCompletion, owner: owner),
state: null);

return _modalFormCompletion.Task;

void ShowDialogProc(ref TaskCompletionSource<DialogResult> tcsModalForm, IWin32Window? owner = default)
void ShowDialogProc(ref TaskCompletionSource<DialogResult> modalFormCompletion, IWin32Window? owner = default)
{
try
{
DialogResult result = ShowDialog(owner);
tcsModalForm.SetResult(result);
modalFormCompletion.SetResult(result);
}
catch (Exception ex)
{
tcsModalForm.SetException(ex);
modalFormCompletion.SetException(ex);
}
finally
{
tcsModalForm = null!;
modalFormCompletion = null!;
}
}
}
Expand Down

0 comments on commit 4c997a8

Please sign in to comment.