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

[FEATURE] prevent accidental use of parent setters #53

Closed
wolframhaussig opened this issue Feb 25, 2024 · 0 comments · Fixed by #54
Closed

[FEATURE] prevent accidental use of parent setters #53

wolframhaussig opened this issue Feb 25, 2024 · 0 comments · Fixed by #54
Assignees

Comments

@wolframhaussig
Copy link
Contributor

Is your feature request related to a problem? Please describe.
For the StylableTextBox, we added HintForeColor and TextForeColor as a replacement of ForeColor. Depending on the current value (empty => show hint), either HintForeColor or TextForeColor will be used for ForeColor. To prevent any accidental use, we already added Browsable(false) and EditorBrowsable(EditorBrowsableState.Never) to not show this property in the GUI editor. Unfortunately, this does not always help:

Control c = new StylableTextBox();
c.ForeColor = Color.Blue;

As the ForeColor is available for Control it can be used without any hint that there is any issue with that.

Describe the solution you'd like
We want to go for 2 different options:

  • for Reflection, we will add a separate Attribute marking this setter for internal use only
  • for callers, we will reuse our existing errorhandling and create an error when used directly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant