Skip to content

Commit

Permalink
Refactor PropertyGridView to use List<GridEntryCollection> instead of…
Browse files Browse the repository at this point in the history
… ArrayList (#8210)

* Refactor PropertyGridView to use List<GridEntryCollection> instead of ArrayList

* Remove blank line
  • Loading branch information
Jericho authored Nov 17, 2022
1 parent 1030aac commit f21bb59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

#nullable disable

using System.Collections;

namespace System.Windows.Forms.PropertyGridInternal
{
internal partial class PropertyGridView
{
internal class GridPositionData
{
private readonly ArrayList _expandedState;
private readonly List<GridEntryCollection> _expandedState;
private readonly GridEntryCollection _selectedItemTree;
private readonly int _itemRow;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#nullable disable

using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Diagnostics;
Expand Down Expand Up @@ -4226,7 +4225,7 @@ public void Reset()

private static void ResetOrigin(Graphics g) => g.ResetTransform();

internal void RestoreHierarchyState(ArrayList expandedItems)
internal void RestoreHierarchyState(List<GridEntryCollection> expandedItems)
{
if (expandedItems is null)
{
Expand All @@ -4239,14 +4238,14 @@ internal void RestoreHierarchyState(ArrayList expandedItems)
}
}

internal ArrayList SaveHierarchyState(GridEntryCollection entries, ArrayList expandedItems = null)
internal List<GridEntryCollection> SaveHierarchyState(GridEntryCollection entries, List<GridEntryCollection> expandedItems = null)
{
if (entries is null)
{
return new ArrayList();
return new();
}

expandedItems ??= new ArrayList();
expandedItems ??= new();

for (int i = 0; i < entries.Count; i++)
{
Expand Down

0 comments on commit f21bb59

Please sign in to comment.