-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update SplashScreen to use CsWin32 and shared library #10047
Conversation
877f249
to
f1987f5
Compare
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.
Overall 👍
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
Changes LGTM! |
Good job. And I want to bring the some more feature to SplashScreen. See #2031 |
@lindexi it should be significantly faster now that it doesn't have to generate all of the interop at start |
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.
Mostly nits, hope that's alright; I've cleared up the catch
for myself, didn't notice the logic got altered for the cleanup.
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/tests/UnitTests/WindowsBase.Tests/Resources.Designer.cs
Outdated
Show resolved
Hide resolved
…t also uses the shared `System.Private.Windows.Core` library built in Windows Forms. This makes `SplashScreen` trim-friendly and improves the performance as it will no longer need to generate the rather extensive interop it used to at startup. This also introduces a bottom level assembly for WPF: `System.Windows.Primitives` where there are no other dependencies other than the WinForms/WPF base assembly: `System.Private.Windows.Core`. `PInvokeCore` is the static class that comes from `System.Private.Windows.Core`. `PInvoke` is the static class from `System.Windows.Primitives`. When C# adds something akin to extension types (currently in the design phase) we'll be able to unify to a single `PInvoke`. Generated types (such as `HWND`) are in the namespaces as specified by the Windows metdata and don't have the same problem with conflicts as CsWin32 won't generate types that already exist. CsWin32 uses `System.Drawing` types where they match Win32 types. `Point` is an example of this. These interchange `System.Drawing` types are in-box with .NET. `System.Private.Windows.Core` provides a lot of useful support functionality, particularly when it comes to interop. The various scope types in this PR are an example. OLE code will come from this assembly after the new APIs are merged in WinForms. I've also deleted a large swath of unused interop. It builds on dotnet#10023, which leverages dotnet#9914. This is an update of dotnet#7929.
3490d2d
to
79ae146
Compare
LGTM, really happy to see this. ❤️ |
Did another pass, changes look good 👍 |
This updates
SplashScreen
to use direct interop built on CsWin32. It also uses the sharedSystem.Private.Windows.Core
library built in Windows Forms.This makes
SplashScreen
trim-friendly and improves the performance as it will no longer need to generate the rather extensive interop it used to at startup.This also introduces a bottom level assembly for WPF:
System.Windows.Primitives
where there are no other dependencies other than the WinForms/WPF base assembly:System.Private.Windows.Core
.PInvokeCore
is the static class that comes fromSystem.Private.Windows.Core
.PInvoke
is the static class fromSystem.Windows.Primitives
. When C# adds something akin to extension types (currently in the design phase) we'll be able to unify to a singlePInvoke
. Generated types (such asHWND
) are in the namespaces as specified by the Windows metdata and don't have the same problem with conflicts as CsWin32 won't generate types that already exist.CsWin32 uses
System.Drawing
types where they match Win32 types.Point
is an example of this. These interchangeSystem.Drawing
types are in-box with .NET.System.Private.Windows.Core
provides a lot of useful support functionality, particularly when it comes to interop. The various scope types in this PR are an example. OLE code will come from this assembly after the new APIs are merged in WinForms.I've also deleted a large swath of unused interop.
It leverages #10023, which leverages #9914 (the first commit), and will be updated when those are merged.
This is an update of #7929.
Microsoft Reviewers: Open in CodeFlow