Remove CA1060 - Move P/Invokes to `NativeMethods` class
Describe the bug
Native invocations should be moved to different class https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1060
To Reproduce
Open the Wpf.Ui.sln Select the Build...Clean Solution menu item Press Ctrl+F5 to build the solution and run it, without connecting the debugger. F5 to build and connect the debugger. Observe the warnings listed above
Expected behavior
No warnings are generated when building.
Screenshots
No response
OS version
11 2610
.NET version
9.0.200-preview.0.25057.12
WPF-UI NuGet version
4.0.0
Additional context
No response
Some or many of these interop methods are not even used. Also, some duplicate system-provided interop, such as all three of the ones defined in Kernel32:
Kernel32.GetLastError -> System.Runtime.InteropServices.Marshal.GetLastSystemError
Kernel32.SetLastError -> System.Runtime.InteropServices.Marshal.SetLastSystemError
IsDebuggerPresent -> System.Diagnostics.Debugger.IsAttached and/or System.Diagnostics.Debugger.IsLogging
Also, the latter 2 have no references, and the former most has only 3 references, all from within comments of User32
I get that perhaps this is meant as just a "placeholder" class for possible future interop methods.
Consider migrating to https://github.com/microsoft/CsWin32 so you don’t have to write the native method headers yourself at all.