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 PropertyGridView to use List<GridEntryCollection> instead of ArrayList #8210

Merged
merged 2 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
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 @@ -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