You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add convenience / performance related methods to ListViewItemCollection / ControlCollection
ListViewItemCollection doesn't have an AddRange that takes an IEnumerable<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 `[..]`, but it does avoid the need for it in some cases.
Copy file name to clipboardexpand all lines: src/System.Windows.Forms/src/GlobalSuppressions.cs
+2
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@
18
18
[assembly:SuppressMessage("Naming","CA1725:Parameter names should match base declaration",Justification="Public API",Scope="member",Target="~M:System.Windows.Forms.FontDialog.RunDialog(System.IntPtr)~System.Boolean")]
19
19
[assembly:SuppressMessage("Naming","CA1725:Parameter names should match base declaration",Justification="Public API",Scope="member",Target="~M:System.Windows.Forms.ImageListStreamer.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")]
20
20
[assembly:SuppressMessage("Naming","CA1725:Parameter names should match base declaration",Justification="Public API",Scope="member",Target="~M:System.Windows.Forms.Control.EndInvoke(System.IAsyncResult)~System.Object")]
21
+
[assembly:SuppressMessage("Naming","CA1725:Parameter names should match base declaration",Justification="Public API",Scope="member",Target="~M:System.Windows.Forms.Control.ControlCollection.IndexOf(System.Windows.Forms.Control)~System.Int32")]
22
+
[assembly:SuppressMessage("Naming","CA1725:Parameter names should match base declaration",Justification="Public API",Scope="member",Target="~M:System.Windows.Forms.ListView.ListViewItemCollection.CopyTo(System.Array,System.Int32)")]
[assembly:SuppressMessage("Performance","CA1815:Override equals and operator equals on value types",Justification="Public API",Scope="type",Target="~T:System.Windows.Forms.ImeModeConversion")]
0 commit comments