Skip to content

Commit 279504f

Browse files
authored
add anes for preview 6 (#4405)
1 parent 7459a14 commit 279504f

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

xml/System.Windows.Forms/ListBox+ObjectCollection.xml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
106106
]]></format>
107107
</remarks>
108+
<exception cref="T:System.ArgumentNullException">.NET 5.0 and later: <paramref name="owner" /> is <see langword="null" />.</exception>
108109
</Docs>
109110
</Member>
110111
<Member MemberName=".ctor">
@@ -138,6 +139,7 @@
138139
139140
]]></format>
140141
</remarks>
142+
<exception cref="T:System.ArgumentNullException">.NET 5.0 and later: Either <paramref name="owner" /> or <paramref name="value" /> is <see langword="null" />.</exception>
141143
</Docs>
142144
</Member>
143145
<Member MemberName=".ctor">
@@ -171,6 +173,7 @@
171173
172174
]]></format>
173175
</remarks>
176+
<exception cref="T:System.ArgumentNullException">.NET 5.0 and later: Either <paramref name="owner" /> or <paramref name="value" /> is <see langword="null" />.</exception>
174177
</Docs>
175178
</Member>
176179
<Member MemberName="Add">
@@ -207,9 +210,7 @@
207210
## Remarks
208211
If the <xref:System.Windows.Forms.ListBox.Sorted%2A> property of the <xref:System.Windows.Forms.ListBox> is set to `true`, the item is inserted into the list alphabetically. Otherwise, the item is inserted at the end of the list. To insert an item into the list box at a specific position, use the <xref:System.Windows.Forms.ListBox.ObjectCollection.Insert%2A> method. To add a set of items to the list box in a single operation, use the <xref:System.Windows.Forms.ListBox.ObjectCollection.AddRange%2A> method. If you want to use the <xref:System.Windows.Forms.ListBox.ObjectCollection.Add%2A> method to add a large number of items to the list, use the <xref:System.Windows.Forms.ListBox.BeginUpdate%2A> and <xref:System.Windows.Forms.ListBox.EndUpdate%2A> methods to prevent the <xref:System.Windows.Forms.ListBox> from repainting each time an item is added to the list until all items are added to the list. When adding items to a <xref:System.Windows.Forms.ListBox>, it is more efficient to sort the items first and then add new items.
209212
210-
When an object is added to the collection, the <xref:System.Windows.Forms.ListBox> first checks to see if the <xref:System.Windows.Forms.ListControl.DisplayMember%2A> property of the <xref:System.Windows.Forms.ListControl> class has the name of a member from the object specified to reference when obtaining the item text. If the <xref:System.Windows.Forms.ListControl.DisplayMember%2A> property does not have a member specified, the <xref:System.Windows.Forms.ListBox> then calls the <xref:System.Object.ToString%2A> method of the object to obtain the text to display in the list.
211-
212-
213+
When an object is added to the collection, the <xref:System.Windows.Forms.ListBox> first checks to see if the <xref:System.Windows.Forms.ListControl.DisplayMember%2A> property of the <xref:System.Windows.Forms.ListControl> class has the name of a member from the object specified to reference when obtaining the item text. If the <xref:System.Windows.Forms.ListControl.DisplayMember%2A> property does not have a member specified, the <xref:System.Windows.Forms.ListBox> then calls the <xref:System.Object.ToString%2A> method of the object to obtain the text to display in the list.
213214
214215
## Examples
215216
The following code example demonstrates how to create a <xref:System.Windows.Forms.ListBox> control that displays multiple items in columns and can have more than one item selected in the control's list. The code for the example adds 50 items to the <xref:System.Windows.Forms.ListBox> using the <xref:System.Windows.Forms.ListBox.ObjectCollection.Add%2A> method of the <xref:System.Windows.Forms.ListBox.ObjectCollection> class and then selects three items from the list using the <xref:System.Windows.Forms.ListBox.SetSelected%2A> method. The code then displays values from the <xref:System.Windows.Forms.ListBox.SelectedObjectCollection> collection (through the <xref:System.Windows.Forms.ListBox.SelectedItems%2A> property) and the <xref:System.Windows.Forms.ListBox.SelectedIndexCollection> (through the <xref:System.Windows.Forms.ListBox.SelectedIndices%2A> property). This example requires that the code is located in and called from a <xref:System.Windows.Forms.Form>.
@@ -221,8 +222,7 @@
221222
]]></format>
222223
</remarks>
223224
<exception cref="T:System.SystemException">There is insufficient space available to add the new item to the list.</exception>
224-
<exception cref="T:System.ArgumentNullException">
225-
<paramref name="item" /> is <see langword="null" />.</exception>
225+
<exception cref="T:System.ArgumentNullException"><paramref name="item" /> is <see langword="null" />.</exception>
226226
</Docs>
227227
</Member>
228228
<MemberGroup MemberName="AddRange">
@@ -262,9 +262,7 @@
262262
<format type="text/markdown"><![CDATA[
263263
264264
## Remarks
265-
If the <xref:System.Windows.Forms.ListBox.Sorted%2A> property of the <xref:System.Windows.Forms.ListBox> is set to `true`, the items are inserted into the list alphabetically. Otherwise, the items are inserted in the order that they occur within the array. This method is typically passed an array of <xref:System.String> objects, but an array of any type of object can be passed to this method. When an object is added to the collection, the <xref:System.Windows.Forms.ListBox> first checks to see if the <xref:System.Windows.Forms.ListControl.DisplayMember%2A> property of the <xref:System.Windows.Forms.ListControl> class has the name of a member from the object specified to reference when obtaining the item text. If the <xref:System.Windows.Forms.ListControl.DisplayMember%2A> property does not have a member specified, the <xref:System.Windows.Forms.ListBox> then calls the <xref:System.Object.ToString%2A> method of the object to obtain the text to display in the list. When using this method to add items to the <xref:System.Windows.Forms.ListBox>, you do not need to call the <xref:System.Windows.Forms.ListBox.BeginUpdate%2A> and <xref:System.Windows.Forms.ListBox.EndUpdate%2A> methods to optimize performance. When adding items to a <xref:System.Windows.Forms.ListBox>, it is more efficient to sort the items first and then add new items. You can use this method to add a group of items to the list or to reuse the items stored in a different <xref:System.Windows.Forms.ListBox>.
266-
267-
265+
If the <xref:System.Windows.Forms.ListBox.Sorted%2A> property of the <xref:System.Windows.Forms.ListBox> is set to `true`, the items are inserted into the list alphabetically. Otherwise, the items are inserted in the order that they occur within the array. This method is typically passed an array of <xref:System.String> objects, but an array of any type of object can be passed to this method. When an object is added to the collection, the <xref:System.Windows.Forms.ListBox> first checks to see if the <xref:System.Windows.Forms.ListControl.DisplayMember%2A> property of the <xref:System.Windows.Forms.ListControl> class has the name of a member from the object specified to reference when obtaining the item text. If the <xref:System.Windows.Forms.ListControl.DisplayMember%2A> property does not have a member specified, the <xref:System.Windows.Forms.ListBox> then calls the <xref:System.Object.ToString%2A> method of the object to obtain the text to display in the list. When using this method to add items to the <xref:System.Windows.Forms.ListBox>, you do not need to call the <xref:System.Windows.Forms.ListBox.BeginUpdate%2A> and <xref:System.Windows.Forms.ListBox.EndUpdate%2A> methods to optimize performance. When adding items to a <xref:System.Windows.Forms.ListBox>, it is more efficient to sort the items first and then add new items. You can use this method to add a group of items to the list or to reuse the items stored in a different <xref:System.Windows.Forms.ListBox>.
268266
269267
## Examples
270268
The following code example demonstrates an owner-drawn <xref:System.Windows.Forms.ListBox> by setting the <xref:System.Windows.Forms.ListBox.DrawMode%2A> property to the `OwnerDrawVariable` value and handling the <xref:System.Windows.Forms.ListBox.DrawItem> and <xref:System.Windows.Forms.ListBox.MeasureItem> events. It also demonstrates setting the <xref:System.Windows.Forms.ListBox.BorderStyle%2A> and <xref:System.Windows.Forms.ListBox.ScrollAlwaysVisible%2A> properties and using the <xref:System.Windows.Forms.ListBox.ObjectCollection.AddRange%2A> method.
@@ -277,6 +275,7 @@
277275
278276
]]></format>
279277
</remarks>
278+
<exception cref="T:System.ArgumentNullException">.NET 5.0 and later: <paramref name="items" /> is <see langword="null" />.</exception>
280279
<altmember cref="M:System.Windows.Forms.ListBox.ObjectCollection.Add(System.Object)" />
281280
</Docs>
282281
</Member>
@@ -314,6 +313,7 @@
314313
315314
]]></format>
316315
</remarks>
316+
<exception cref="T:System.ArgumentNullException">.NET 5.0 and later: <paramref name="value" /> is <see langword="null" />.</exception>
317317
<altmember cref="M:System.Windows.Forms.ListBox.ObjectCollection.Add(System.Object)" />
318318
</Docs>
319319
</Member>
@@ -388,8 +388,7 @@
388388
389389
]]></format>
390390
</remarks>
391-
<exception cref="T:System.ArgumentNullException">
392-
<paramref name="value" /> is <see langword="null" />.</exception>
391+
<exception cref="T:System.ArgumentNullException"><paramref name="value" /> is <see langword="null" />.</exception>
393392
<altmember cref="M:System.Windows.Forms.ListBox.ObjectCollection.IndexOf(System.Object)" />
394393
<altmember cref="M:System.Windows.Forms.ListBox.FindString(System.String)" />
395394
<altmember cref="M:System.Windows.Forms.ListBox.FindStringExact(System.String)" />
@@ -436,6 +435,7 @@
436435
437436
]]></format>
438437
</remarks>
438+
<exception cref="T:System.ArgumentNullException">.NET 5.0 and later: <paramref name="destination" /> is <see langword="null" />.</exception>
439439
</Docs>
440440
</Member>
441441
<Member MemberName="Count">
@@ -578,8 +578,7 @@
578578
]]></format>
579579
</remarks>
580580
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> parameter is less than zero or greater than value of the <see cref="P:System.Windows.Forms.ListBox.ObjectCollection.Count" /> property of the <see cref="T:System.Windows.Forms.ListBox.ObjectCollection" /> class.</exception>
581-
<exception cref="T:System.ArgumentNullException">
582-
<paramref name="item" /> is <see langword="null" />.</exception>
581+
<exception cref="T:System.ArgumentNullException"><paramref name="item" /> is <see langword="null" />.</exception>
583582
</Docs>
584583
</Member>
585584
<Member MemberName="IsReadOnly">
@@ -798,6 +797,7 @@
798797
</remarks>
799798
<forInternalUseOnly />
800799
<exception cref="T:System.ArrayTypeMismatchException">The array type is not compatible with the items in the <see cref="T:System.Windows.Forms.ListBox.ObjectCollection" />.</exception>
800+
<exception cref="T:System.ArgumentNullException">.NET 5.0 and later: <paramref name="destination" /> is <see langword="null" />.</exception>
801801
</Docs>
802802
</Member>
803803
<Member MemberName="System.Collections.ICollection.IsSynchronized">
@@ -909,8 +909,7 @@
909909
]]></format>
910910
</remarks>
911911
<forInternalUseOnly />
912-
<exception cref="T:System.ArgumentNullException">
913-
<paramref name="item" /> is <see langword="null" />.</exception>
912+
<exception cref="T:System.ArgumentNullException"><paramref name="item" /> is <see langword="null" />.</exception>
914913
<exception cref="T:System.ArgumentException">The current <see cref="T:System.Windows.Forms.ListBox" /> has a data source.</exception>
915914
<exception cref="T:System.SystemException">There is insufficient space available to store the new item.</exception>
916915
</Docs>

0 commit comments

Comments
 (0)