-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add first WinForms Async experimental APIs #11828
Add first WinForms Async experimental APIs #11828
Conversation
src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlNativeWindow.cs
Show resolved
Hide resolved
@@ -6858,6 +6858,14 @@ private bool NotifyValidating() | |||
return ev.Cancel; | |||
} | |||
|
|||
/// <summary> | |||
/// Called by the NativeWindow callback, when an exception is caught. This will be rerouted to the | |||
/// Application.ThreadException, but in certain Async scenarios it makes more sense, to be able to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What certain scenarios?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Showing Forms, whose Exception handling was always handled unfortunate to begin with, maybe later also Popups for .NET 10.
Example: Throw an exception in Form.OnLoad and try to gracefully handle it, when you Show (not Dialog-show) the form from another form. It's a discoverability nightmare for so many folks. My aim is it to make it more intuitively. And retrofit at least analyzers for it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example needs added in remarks. Pull out everything but the summary into remarks.
/// <param name="action">The synchronous action to execute.</param> | ||
/// <param name="cancellationToken">The cancellation token.</param> | ||
/// <returns>A task representing the operation and containing the function's result.</returns> | ||
[Experimental(DiagnosticIDs.ExperimentalAsync, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the plan was for these ones (InvokeAsync) to not be experimental.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll ask Immo.
I am with you, but then I would beg you to keep the option for me to REALLY test InvokeAsync
additionally coming Saturday and Sunday and then, should I find something, do a follow-up PR before we snap on Sunday afternoon. Would you let me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Not experimental.
src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs
Show resolved
Hide resolved
b1a2e58
to
8b55b0c
Compare
src/System.Windows.Forms/src/System/Windows/Forms/Control_InvokeAsync.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Control_InvokeAsync.cs
Show resolved
Hide resolved
dd449fb
to
7b3d202
Compare
7b3d202
to
214f8ee
Compare
51e9159
to
908f0bc
Compare
src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs
Show resolved
Hide resolved
...sualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb
Show resolved
Hide resolved
908f0bc
to
6ab78b8
Compare
484eefb
to
5870b4b
Compare
5870b4b
to
71b6034
Compare
Closing this PR, as it needs to be cherry-picked into a new one based on main. |
Note that this is not dead, we're simply trying to detangle it from some other work to ensure it gets in for RC1 as an encapsulated change rather than dependent on other PRs in flight. |
Note: This PR is based on #10985.
That's why this PR has been based against feature/darkmode which holds the exact copy of the DarkMode feature.
Introduces new experimental APIs for .NET 9:
Control.InvokeAsync
.TaskDialog.ShowDialogAsync
.Form.ShowAsync
.Form.ShowDialogAsync
Fixes #10739.
Replaces #9827.