Skip to content
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

Remove the word Attribute from Attributes in generated code and optionally remove namespaces #28

Open
jozefizso opened this issue Sep 7, 2012 · 0 comments
Labels
bug Something isn't working CodePlex

Comments

@jozefizso
Copy link
Member

Issue from Fri, 07 Sep 2012 13:09:23 GMT Originally opened at https://clrinterop.codeplex.com/workitem/10470

The code generated by this tool is very verbose. Since the general use case is to hand edit the generated code, it should be made more terser for readability.
 
First of all all attribute decorations should not include the word Attribute. e.g DllImportAttribute should become DllImport. Secondly, there should be an option to not qualify attributes with namespaces. Here is a real life example:
 
Currently:
[System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="TraceOpenLogFile")]
public static extern short TraceOpenLogFile(
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] System.Text.StringBuilder s,
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] System.Text.StringBuilder t,
uint w) ;
 
After
[DllImport("", EntryPoint="TraceOpenLogFile")]
public static extern short public static short TraceOpenLogFile(
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder s,
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder t,
uint w);
 
 
In both cases i formatted the code slightly.

@jozefizso jozefizso added CodePlex bug Something isn't working labels Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CodePlex
Projects
None yet
Development

No branches or pull requests

1 participant