-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix 13227: Update SetName of DesignerExtenders.NameExtenderProvider to virtual method #13558
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
base: main
Are you sure you want to change the base?
Fix 13227: Update SetName of DesignerExtenders.NameExtenderProvider to virtual method #13558
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request updates the SetName method in DesignerExtenders.NameExtenderProvider from static to virtual to enable the Name property for all controls in DemoConsole.
- Changed SetName from static to virtual to support runtime polymorphism.
Comments suppressed due to low confidence (1)
src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/DesignerExtenders.NameExtenderProvider.cs:91
- Changing SetName from static to virtual can impact existing callers that depend on static invocation. Verify that all usages of SetName are updated to appropriately handle instance-based calls.
public virtual void SetName(IComponent comp, string newName)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13558 +/- ##
===================================================
- Coverage 76.59927% 76.59677% -0.00250%
===================================================
Files 3230 3230
Lines 639151 639151
Branches 47295 47295
===================================================
- Hits 489585 489569 -16
- Misses 145994 146009 +15
- Partials 3572 3573 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
@@ -88,7 +88,7 @@ public virtual bool CanExtend(object o) | |||
//github.com/ This is an extender property that we offer to all components | |||
//github.com/ on the form. It implements the "Name" property. | |||
//github.com/ </summary> | |||
public static void SetName(IComponent comp, string newName) | |||
public virtual void SetName(IComponent comp, string newName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using the Designer Extenders only internally. Are there "only" for testing support?
Fixes #13227
Proposed changes
SetName
ofDesignerExtenders.NameExtenderProvider
fromstatic
tovirtual
methodCustomer Impact
Regression?
Risk
Screenshots
Before
In DemoConsole test app of WinForms repo,
Name
property for all controls is disabled.NET 10:
After
Name
property for all controls is enabledTest methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow