Skip to content

Commit 1534f9a

Browse files
carlossanlopRon Petrusha
authored andcommitted
Ported System.Collections source code comments to Docs (#2306)
* Ported System.Collections source code comments to Docs * Apply suggestions from code review Applying suggestions provided by rpetrusha. Co-Authored-By: carlossanlop <[email protected]> * Fixed link. * Fixed broken xrefs
1 parent d3d4b0f commit 1534f9a

19 files changed

+108
-49
lines changed

xml/System.Collections.Concurrent/BlockingCollection`1.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,7 @@
12491249
<exception cref="T:System.InvalidOperationException">The underlying collection was modified outside of this <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instance, or the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> is empty and the collection has been marked as complete for adding.</exception>
12501250
<related type="Article" href="https://msdn.microsoft.com/library/2e7ca21f-786c-4367-96be-0cf3f3dcc6bd">Thread-Safe Collections</related>
12511251
<related type="Article" href="https://msdn.microsoft.com/library/987ea3d7-0ad5-4238-8b64-331ce4eb3f0b">BlockingCollection Overview</related>
1252+
<exception cref="T:System.OperationCanceledException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> is empty and has been marked as complete with regards to additions.</exception>
12521253
</Docs>
12531254
</Member>
12541255
<Member MemberName="Take">
@@ -2415,4 +2416,4 @@
24152416
</Docs>
24162417
</Member>
24172418
</Members>
2418-
</Type>
2419+
</Type>

xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@
597597
</remarks>
598598
<exception cref="T:System.ArgumentNullException">
599599
<paramref name="key" />, <paramref name="addValueFactory" />, or <paramref name="updateValueFactory" /> is a null reference (Nothing in Visual Basic).</exception>
600+
<exception cref="T:System.OverflowException">The dictionary contains too many elements.</exception>
600601
</Docs>
601602
</Member>
602603
<Member MemberName="Clear">
@@ -972,6 +973,8 @@
972973
973974
]]></format>
974975
</remarks>
976+
<exception cref="T:System.ArgumentNullException"><paramref name="key" /> is a <see langword="null" /> reference (Nothing in Visual Basic).</exception>
977+
<exception cref="T:System.OverflowException">The dictionary contains too many elements.</exception>
975978
</Docs>
976979
</Member>
977980
<Member MemberName="IsEmpty">

xml/System.Collections.Immutable/IImmutableQueue`1.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<summary>Removes the first element in the immutable queue, and returns the new queue.</summary>
9393
<returns>The new immutable queue with the first element removed. This value is never <c>null</c>.</returns>
9494
<remarks>To be added.</remarks>
95+
<exception cref="T:System.InvalidOperationException">The queue is empty.</exception>
9596
</Docs>
9697
</Member>
9798
<Member MemberName="Enqueue">
@@ -176,7 +177,8 @@
176177
<summary>Returns the element at the beginning of the immutable queue without removing it.</summary>
177178
<returns>The element at the beginning of the queue.</returns>
178179
<remarks>To be added.</remarks>
180+
<exception cref="T:System.InvalidOperationException">The queue is empty.</exception>
179181
</Docs>
180182
</Member>
181183
</Members>
182-
</Type>
184+
</Type>

xml/System.Collections.Immutable/IImmutableStack`1.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
<summary>Returns the element at the top of the immutable stack without removing it.</summary>
113113
<returns>The element at the top of the stack.</returns>
114114
<remarks>To be added.</remarks>
115+
<exception cref="T:System.InvalidOperationException">The stack is empty.</exception>
115116
</Docs>
116117
</Member>
117118
<Member MemberName="Pop">
@@ -139,6 +140,7 @@
139140
<summary>Removes the element at the top of the immutable stack and returns the new stack.</summary>
140141
<returns>The new stack; never <c>null</c></returns>
141142
<remarks>To be added.</remarks>
143+
<exception cref="T:System.InvalidOperationException">The stack is empty.</exception>
142144
</Docs>
143145
</Member>
144146
<Member MemberName="Push">
@@ -172,4 +174,4 @@
172174
</Docs>
173175
</Member>
174176
</Members>
175-
</Type>
177+
</Type>

xml/System.Collections.Immutable/ImmutableArray.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@
152152
<remarks>To be added.</remarks>
153153
<exception cref="T:System.InvalidOperationException">
154154
<paramref name="value" /> does not implement <see cref="T:System.IComparable" /> or the search encounters an element that does not implement <see cref="T:System.IComparable" />.</exception>
155+
<exception cref="T:System.ArgumentException"><paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="array" />.</exception>
156+
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="index" /> is less than the lower bound of <paramref name="array" />.
157+
158+
-or-
159+
160+
<paramref name="length" /> is less than zero.</exception>
155161
</Docs>
156162
</Member>
157163
<Member MemberName="BinarySearch&lt;T&gt;">
@@ -198,6 +204,16 @@
198204
<remarks>To be added.</remarks>
199205
<exception cref="T:System.InvalidOperationException">
200206
<paramref name="comparer" /> is null and <paramref name="value" /> does not implement <see cref="T:System.IComparable" /> or the search encounters an element that does not implement <see cref="T:System.IComparable" />.</exception>
207+
<exception cref="T:System.ArgumentException"><paramref name="index" /> and <paramref name="length" /> do not specify a valid range in <paramref name="array" />.
208+
209+
-or-
210+
211+
<paramref name="comparer" /> is <see langword="null" />, and <paramref name="value" /> is of a type that is not compatible with the elements of <paramref name="array" />.</exception>
212+
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="index" /> is less than the lower bound of <paramref name="array" />.
213+
214+
-or-
215+
216+
<paramref name="length" /> is less than zero.</exception>
201217
</Docs>
202218
</Member>
203219
<Member MemberName="Create&lt;T&gt;">
@@ -877,4 +893,4 @@
877893
</Docs>
878894
</Member>
879895
</Members>
880-
</Type>
896+
</Type>

xml/System.Collections.Immutable/ImmutableArray`1+Builder.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,10 +805,11 @@
805805
<Parameter Name="index" Type="System.Int32" />
806806
</Parameters>
807807
<Docs>
808-
<param name="index">To be added.</param>
809-
<summary>To be added.</summary>
808+
<param name="index">The item index.</param>
809+
<summary>Gets a read-only reference to the element at the specified index.</summary>
810810
<returns>To be added.</returns>
811811
<remarks>To be added.</remarks>
812+
<exception cref="T:System.IndexOutOfRangeException"><paramref name="index" /> is greater or equal to the array count.</exception>
812813
</Docs>
813814
</Member>
814815
<Member MemberName="LastIndexOf">
@@ -1338,4 +1339,4 @@
13381339
</Docs>
13391340
</Member>
13401341
</Members>
1341-
</Type>
1342+
</Type>

xml/System.Collections.Immutable/ImmutableArray`1.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,9 +1042,9 @@
10421042
<Parameter Name="index" Type="System.Int32" Index="0" FrameworkAlternate="netcore-2.1" />
10431043
</Parameters>
10441044
<Docs>
1045-
<param name="index">To be added.</param>
1046-
<summary>To be added.</summary>
1047-
<returns>To be added.</returns>
1045+
<param name="index">The zero-based index of the element to get a reference to.</param>
1046+
<summary>Gets a read-only reference to the element at the specified <paramref name="index" /> in the read-only list.</summary>
1047+
<returns>A read-only reference to the element at the specified <paramref name="index" /> in the read-only list.</returns>
10481048
<remarks>To be added.</remarks>
10491049
</Docs>
10501050
</Member>
@@ -2443,6 +2443,7 @@
24432443
<summary>Returns an enumerator that iterates through the immutable array.</summary>
24442444
<returns>An enumerator that iterates through the immutable array.</returns>
24452445
<remarks>To be added.</remarks>
2446+
<exception cref="T:System.InvalidOperationException">The <see cref="P:System.Collections.Immutable.ImmutableArray`1.IsDefault" /> property returns <see langword="true" />.</exception>
24462447
</Docs>
24472448
</Member>
24482449
<Member MemberName="System.Collections.IList.Add">
@@ -2475,6 +2476,7 @@
24752476
<summary>Throws <see cref="T:System.NotSupportedException" /> in all cases.</summary>
24762477
<returns>Throws <see cref="T:System.NotSupportedException" /> in all cases.</returns>
24772478
<remarks>To be added.</remarks>
2479+
<exception cref="T:System.NotSupportedException">Thrown in all cases.</exception>
24782480
</Docs>
24792481
</Member>
24802482
<Member MemberName="System.Collections.IList.Clear">
@@ -2503,6 +2505,7 @@
25032505
<Docs>
25042506
<summary>Throws <see cref="T:System.NotSupportedException" /> in all cases.</summary>
25052507
<remarks>To be added.</remarks>
2508+
<exception cref="T:System.NotSupportedException">Thrown in all cases.</exception>
25062509
</Docs>
25072510
</Member>
25082511
<Member MemberName="System.Collections.IList.Contains">
@@ -2600,6 +2603,7 @@
26002603
<param name="value">The value to insert.</param>
26012604
<summary>Throws <see cref="T:System.NotSupportedException" /> in all cases.</summary>
26022605
<remarks>To be added.</remarks>
2606+
<exception cref="T:System.NotSupportedException">Thrown in all cases.</exception>
26032607
</Docs>
26042608
</Member>
26052609
<Member MemberName="System.Collections.IList.IsFixedSize">
@@ -2736,6 +2740,7 @@
27362740
<param name="value">The value to remove from the array.</param>
27372741
<summary>Throws <see cref="T:System.NotSupportedException" /> in all cases.</summary>
27382742
<remarks>To be added.</remarks>
2743+
<exception cref="T:System.NotSupportedException">Thrown in all cases.</exception>
27392744
</Docs>
27402745
</Member>
27412746
<Member MemberName="System.Collections.IList.RemoveAt">
@@ -2767,6 +2772,7 @@
27672772
<param name="index">The index of the item to remove.</param>
27682773
<summary>Throws <see cref="T:System.NotSupportedException" /> in all cases.</summary>
27692774
<remarks>To be added.</remarks>
2775+
<exception cref="T:System.NotSupportedException">Thrown in all cases.</exception>
27702776
</Docs>
27712777
</Member>
27722778
<Member MemberName="System.Collections.Immutable.IImmutableList&lt;T&gt;.Add">
@@ -3403,4 +3409,4 @@
34033409
</Docs>
34043410
</Member>
34053411
</Members>
3406-
</Type>
3412+
</Type>

xml/System.Collections.Immutable/ImmutableDictionary`2+Builder.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,9 @@
456456
<summary>Gets or sets the element with the specified key.</summary>
457457
<value>The element that has the specified key.</value>
458458
<remarks>To be added.</remarks>
459+
<exception cref="T:System.ArgumentNullException"><paramref name="key" /> is <see langword="null" />.</exception>
460+
<exception cref="T:System.Collections.Generic.KeyNotFoundException">The property is being retrieved, and <paramref name="key" /> is not found.</exception>
461+
<exception cref="T:System.NotSupportedException">The property is being set, and the <see cref="T:System.Collections.Generic.IDictionary`2" /> is read-only.</exception>
459462
</Docs>
460463
</Member>
461464
<Member MemberName="KeyComparer">
@@ -1401,4 +1404,4 @@
14011404
</Docs>
14021405
</Member>
14031406
</Members>
1404-
</Type>
1407+
</Type>

xml/System.Collections.Immutable/ImmutableInterlocked.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
<Parameter Name="updateValueFactory" Type="System.Func&lt;TKey,TValue,TValue&gt;" />
5858
</Parameters>
5959
<Docs>
60-
<typeparam name="TKey">To be added.</typeparam>
61-
<typeparam name="TValue">To be added.</typeparam>
60+
<typeparam name="TKey">The type of key stored by the dictionary.</typeparam>
61+
<typeparam name="TValue">The type of value stored by the dictionary.</typeparam>
6262
<param name="location">The variable or field to atomically update if the specified is not in the dictionary.</param>
6363
<param name="key">The key for the value to add or update.</param>
6464
<param name="addValueFactory">The function that receives the key and returns a new value to add to the dictionary when no value previously exists.</param>
@@ -99,8 +99,8 @@
9999
<Parameter Name="updateValueFactory" Type="System.Func&lt;TKey,TValue,TValue&gt;" />
100100
</Parameters>
101101
<Docs>
102-
<typeparam name="TKey">To be added.</typeparam>
103-
<typeparam name="TValue">To be added.</typeparam>
102+
<typeparam name="TKey">The type of key stored by the dictionary.</typeparam>
103+
<typeparam name="TValue">The type of value stored by the dictionary.</typeparam>
104104
<param name="location">The variable or field to atomically update if the specified is not in the dictionary.</param>
105105
<param name="key">The key for the value to add or update.</param>
106106
<param name="addValue">The value to use if no previous value exists.</param>
@@ -259,7 +259,7 @@
259259
<Docs>
260260
<typeparam name="TKey">The type of the keys contained in the collection.</typeparam>
261261
<typeparam name="TValue">The type of the values contained in the collection.</typeparam>
262-
<typeparam name="TArg">To be added.</typeparam>
262+
<typeparam name="TArg">The type of the argument supplied to the value factory.</typeparam>
263263
<param name="location">The variable or field to update if the specified is not in the dictionary.</param>
264264
<param name="key">The key for the value to retrieve or add.</param>
265265
<param name="valueFactory">The function to execute to obtain the value to insert into the dictionary if the key is not found.</param>
@@ -707,4 +707,4 @@
707707
</Docs>
708708
</Member>
709709
</Members>
710-
</Type>
710+
</Type>

xml/System.Collections.Immutable/ImmutableList`1+Builder.xml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
165165
]]></format>
166166
</remarks>
167+
<exception cref="T:System.InvalidOperationException">The default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" /> cannot find an implementation of the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface for type T.</exception>
167168
</Docs>
168169
</Member>
169170
<Member MemberName="BinarySearch">
@@ -203,6 +204,8 @@
203204
204205
]]></format>
205206
</remarks>
207+
<exception cref="T:System.InvalidOperationException"><paramref name="comparer" /> is <see langword="null" />, and the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" /> cannot find an implementation of the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface for type T.
208+
</exception>
206209
</Docs>
207210
</Member>
208211
<Member MemberName="BinarySearch">
@@ -246,6 +249,12 @@
246249
247250
]]></format>
248251
</remarks>
252+
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="index" /> is less than 0.
253+
-or-
254+
255+
<paramref name="count" /> is less than 0.</exception>
256+
<exception cref="T:System.ArgumentException"><paramref name="index" /> and <paramref name="count" /> do not denote a valid range in the <see cref="T:System.Collections.Generic.List`1" />.</exception>
257+
<exception cref="T:System.InvalidOperationException"><paramref name="comparer" /> is <see langword="null" />, and the default comparer <see cref="P:System.Collections.Generic.Comparer`1.Default" /> cannot find an implementation of the <see cref="T:System.IComparable`1" /> generic interface or the <see cref="T:System.IComparable" /> interface for type T.</exception>
249258
</Docs>
250259
</Member>
251260
<Member MemberName="Clear">
@@ -1133,9 +1142,9 @@
11331142
<Parameter Name="index" Type="System.Int32" Index="0" FrameworkAlternate="netcore-2.2" />
11341143
</Parameters>
11351144
<Docs>
1136-
<param name="index">To be added.</param>
1137-
<summary>To be added.</summary>
1138-
<returns>To be added.</returns>
1145+
<param name="index">The index of the desired element.</param>
1146+
<summary>Gets a read-only reference to the value for a given <paramref name="index" /> into the list.</summary>
1147+
<returns>A read-only reference to the value at the specified <paramref name="index" />.</returns>
11391148
<remarks>To be added.</remarks>
11401149
</Docs>
11411150
</Member>
@@ -1507,6 +1516,7 @@
15071516
<param name="comparison">The object to use when comparing elements.</param>
15081517
<summary>Sorts the elements in the entire immutable list by using the specified comparison object.</summary>
15091518
<remarks>To be added.</remarks>
1519+
<exception cref="T:System.ArgumentNullException"><paramref name="comparison" /> is <see langword="null" />.</exception>
15101520
</Docs>
15111521
</Member>
15121522
<Member MemberName="Sort">
@@ -2148,4 +2158,4 @@
21482158
</Docs>
21492159
</Member>
21502160
</Members>
2151-
</Type>
2161+
</Type>

0 commit comments

Comments
 (0)