Is your feature request related to a problem? Please describe.
I find using NativeMethods.txt to be hard to use because on complex scenarios where you have multiple classes using overlapping sets of native methods, it's hard to track what's in use and what's not.
Describe the solution you'd like
As an alternative to declaring NativeMethods.txt , I would like to use this approach:
[Shell32Import( "GetIconInfo", "DestroyIcon")]
[User32Import("*")] // import all user32 methods
static class SomeWrapperClass
{
}
This has the advantage that if you have multiple projects using CsWin32, you can copy a class decorated with these attributes from one project to another, without requiring to manually tailor a NativeMethods.txt. The library would simply scan all the classes using these attributes and would derive the set of methods in use by all the classes.
It's a neat idea. And perhaps at some point when things stabilize we can take the time to deliver this. But at this point we're not planning on this. Please keep the feedback coming.
Is your feature request related to a problem? Please describe.
I find using NativeMethods.txt to be hard to use because on complex scenarios where you have multiple classes using overlapping sets of native methods, it's hard to track what's in use and what's not.
Describe the solution you'd like
As an alternative to declaring NativeMethods.txt , I would like to use this approach:
This has the advantage that if you have multiple projects using CsWin32, you can copy a class decorated with these attributes from one project to another, without requiring to manually tailor a NativeMethods.txt. The library would simply scan all the classes using these attributes and would derive the set of methods in use by all the classes.
Describe alternatives you've considered
Additional context