-
Notifications
You must be signed in to change notification settings - Fork 983
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
Refactor AxPropertyDescriptor
to replace ArrayList
#8152
Conversation
There is a section where there is a winforms/src/System.Windows.Forms/src/System/Windows/Forms/AxHost.AxPropertyDescriptor.cs Lines 276 to 278 in 70a0680
Should I use ToArray() on the List instead? I wanted to keep the changes to a minimum hence why I didn't do it. |
src/System.Windows.Forms/src/System/Windows/Forms/AxHost.AxPropertyDescriptor.cs
Outdated
Show resolved
Hide resolved
I don't see why not. it creates a new copy of array. |
@@ -268,16 +267,13 @@ internal void UpdateAttributes() | |||
return; | |||
} | |||
|
|||
ArrayList attributes = new ArrayList(AttributeArray); | |||
List<Attribute> attributes = new(AttributeArray); | |||
foreach (Attribute attr in _updateAttributes) | |||
{ | |||
attributes.Add(attr); |
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.
I think this foreach equal to
attributes.AddRange(_updateAttributes);
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.
Good idea. Could you put in a PR?
Refactored
AxPropertyDescriptor
to replaceArrayList
withList<T>
Related: #8140
Microsoft Reviewers: Open in CodeFlow