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

VB -> C#: Don't generate unnecessary properties for WithEvents field #572

Closed
GrahamTheCoder opened this issue May 11, 2020 · 1 comment
Closed
Labels
enhancement VB -> C# Specific to VB -> C# conversion

Comments

@GrahamTheCoder
Copy link
Member

Is your feature request related to a problem? Please describe.
In order to convert a WithEvents field, the converter turns it into a property with a backing field (as the VB compiler also does).
If the field is only internally visible and has no Handles methods, this is redundant, and non-idiomatic C#.

Describe the solution you'd like
Use the field directly in the case described.

Describe alternatives you've considered
Leave it as it is now for consistency and simplicity of implementation

Additional context
It surprised someone in its current state, which is usually a bad sign:
#569 (comment)

@FrancisVerreault
Copy link

I just experienced it on a very big project. Every component have been updated with an underscore at the begining of the name to let the original name for the getter/setter. It also added renames in the codes so yep there should be an option to choose if you want generated getter and setter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

No branches or pull requests

2 participants