Skip to content

Commit

Permalink
Refactor a couple more occurrences of ArrayList
Browse files Browse the repository at this point in the history
  • Loading branch information
elachlan committed Feb 22, 2023
1 parent 1a4ba6d commit 9ef18b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public BehaviorDataObject(ICollection dragComponents, Control source, DropSource

internal void CleanupDrag() => _sourceBehavior.CleanupDrag();

internal ArrayList GetSortedDragControls(ref int primaryControlIndex) => _sourceBehavior.GetSortedDragControls(ref primaryControlIndex);
internal List<IComponent> GetSortedDragControls(ref int primaryControlIndex) => _sourceBehavior.GetSortedDragControls(ref primaryControlIndex);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1005,10 +1005,10 @@ private void InitiateDrag(Point initialMouseLocation, ICollection<IComponent> dr
cleanedUpDrag = false;
}

internal ArrayList GetSortedDragControls(ref int primaryControlIndex)
internal List<IComponent> GetSortedDragControls(ref int primaryControlIndex)
{
//create our list of controls-to-drag
ArrayList dragControls = new ArrayList();
List<IComponent> dragControls = new();
primaryControlIndex = -1;
if ((dragComponents is not null) && (dragComponents.Length > 0))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ internal Adorner SelectionGlyphAdorner
/// This method fist calls the recursive AddControlGlyphs() method. When finished, we add the final glyph(s)
/// to the root comp.
/// </summary>
private void AddAllControlGlyphs(Control parent, ArrayList selComps, object primarySelection)
private void AddAllControlGlyphs(Control parent, List<IComponent> selComps, object primarySelection)
{
foreach (Control control in parent.Controls)
{
Expand Down Expand Up @@ -436,7 +436,7 @@ private void OnSelectionChanged(object sender, EventArgs e)
_selectionAdorner.Glyphs.Clear();
_bodyAdorner.Glyphs.Clear();

ArrayList selComps = new ArrayList(_selSvc.GetSelectedComponents());
List<IComponent> selComps = _selSvc.GetSelectedComponents().Cast<IComponent>().ToList();
object primarySelection = _selSvc.PrimarySelection;

//add all control glyphs to all controls on rootComp
Expand Down

0 comments on commit 9ef18b8

Please sign in to comment.