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

Add convenience / perf methods to ListViewItem/ControlCollection #10944

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on May 3, 2024

  1. ListViewItemCollection doesn't have an AddRange that takes an `IE…

    …numerable<ListViewItem>`, which necessitates unnecessary array allocations when adding from a collection.
    
    It also doesn't implement a generic `IList<T>` which makes typed usage and LINQ usage difficult. This adds that.
    
    Also add `IEnumerable<Control>` to `ControlCollection` to address the LINQ scenario. Control has `IList`, but indexed setting throws. I don't want to add `IList<Control>` until we've had time to evaluate the implications of implicitly doing the public steps with the collection that replicate what those setters should be doing.
    
    Also tweak `ArrangedElementCollection` so the static empty collection can't be written to.
    
    This doesn't fix the ambiguity of `AddRange([..])` with `ListViewItemCollection`, but it does avoid the need for it in some cases.
    JeremyKuhne committed May 3, 2024
    Configuration menu
    Copy the full SHA
    2bad759 View commit details
    Browse the repository at this point in the history