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

Refactor ControlDesigner to replace ArrayList with List<T> #8669

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,17 @@ public override ICollection AssociatedComponents
{
get
{
ArrayList sitedChildren = null;
foreach (Control c in Control.Controls)
List<IComponent> sitedChildren = null;
foreach (Control control in Control.Controls)
{
if (c.Site is not null)
if (control.Site is not null)
{
sitedChildren ??= new ArrayList();

sitedChildren.Add(c);
sitedChildren ??= new();
sitedChildren.Add(control);
}
}

if (sitedChildren is not null)
{
return sitedChildren;
}

return base.AssociatedComponents;
return sitedChildren ?? base.AssociatedComponents;
}
}

Expand Down Expand Up @@ -1430,7 +1424,7 @@ protected virtual void OnMouseDragMove(int x, int y)
if (BehaviorService is not null && selectionService is not null)
{
// create our list of controls-to-drag
ArrayList dragControls = new ArrayList();
List<IComponent> dragControls = new();
ICollection selComps = selectionService.GetSelectedComponents();

// must identify a required parent to avoid dragging mixes of children
Expand Down