Skip to content

Commit 95591fd

Browse files
authored
Add missing docs for System.Collections[.Generic] (#4121)
* Add missing docs for System.Collections[.Generic] * Add exceptions * Add System. prefix to exceptions * Address feedback - use tool to port exceptions
1 parent c29b697 commit 95591fd

File tree

7 files changed

+136
-56
lines changed

7 files changed

+136
-56
lines changed

xml/System.Collections.Generic/Dictionary`2.xml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="Dictionary&lt;TKey,TValue&gt;" FullName="System.Collections.Generic.Dictionary&lt;TKey,TValue&gt;">
1+
<Type Name="Dictionary&lt;TKey,TValue&gt;" FullName="System.Collections.Generic.Dictionary&lt;TKey,TValue&gt;">
22
<TypeSignature Language="C#" Value="public class Dictionary&lt;TKey,TValue&gt; : System.Collections.Generic.ICollection&lt;System.Collections.Generic.KeyValuePair&lt;TKey,TValue&gt;&gt;, System.Collections.Generic.IDictionary&lt;TKey,TValue&gt;, System.Collections.Generic.IEnumerable&lt;System.Collections.Generic.KeyValuePair&lt;TKey,TValue&gt;&gt;, System.Collections.Generic.IReadOnlyCollection&lt;System.Collections.Generic.KeyValuePair&lt;TKey,TValue&gt;&gt;, System.Collections.Generic.IReadOnlyDictionary&lt;TKey,TValue&gt;, System.Collections.IDictionary" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6" />
33
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Dictionary`2&lt;TKey, TValue&gt; extends System.Object implements class System.Collections.Generic.ICollection`1&lt;valuetype System.Collections.Generic.KeyValuePair`2&lt;!TKey, !TValue&gt;&gt;, class System.Collections.Generic.IDictionary`2&lt;!TKey, !TValue&gt;, class System.Collections.Generic.IEnumerable`1&lt;valuetype System.Collections.Generic.KeyValuePair`2&lt;!TKey, !TValue&gt;&gt;, class System.Collections.Generic.IReadOnlyCollection`1&lt;valuetype System.Collections.Generic.KeyValuePair`2&lt;!TKey, !TValue&gt;&gt;, class System.Collections.Generic.IReadOnlyDictionary`2&lt;!TKey, !TValue&gt;, class System.Collections.ICollection, class System.Collections.IDictionary, class System.Collections.IEnumerable" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6" />
44
<TypeSignature Language="DocId" Value="T:System.Collections.Generic.Dictionary`2" />
@@ -331,9 +331,13 @@
331331
<Parameter Name="collection" Type="System.Collections.Generic.IEnumerable&lt;System.Collections.Generic.KeyValuePair&lt;TKey,TValue&gt;&gt;" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0" />
332332
</Parameters>
333333
<Docs>
334-
<param name="collection">To be added.</param>
335-
<summary>To be added.</summary>
334+
<param name="collection">The <see cref="T:System.Collections.Generic.IEnumerable`1" /> whose elements are copied to the new <see cref="T:System.Collections.Generic.Dictionary`2" />.</param>
335+
<summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2" /> class that contains elements copied from the specified <see cref="T:System.Collections.Generic.IEnumerable`1" />.</summary>
336336
<remarks>To be added.</remarks>
337+
<exception cref="T:System.ArgumentNullException">
338+
<paramref name="collection" /> is <see langword="null" />.</exception>
339+
<exception cref="T:System.ArgumentException">
340+
<paramref name="collection" /> contains one or more duplicated keys.</exception>
337341
</Docs>
338342
</Member>
339343
<Member MemberName=".ctor">
@@ -567,10 +571,14 @@
567571
<Parameter Name="comparer" Type="System.Collections.Generic.IEqualityComparer&lt;TKey&gt;" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0" />
568572
</Parameters>
569573
<Docs>
570-
<param name="collection">To be added.</param>
571-
<param name="comparer">To be added.</param>
572-
<summary>To be added.</summary>
574+
<param name="collection">The <see cref="T:System.Collections.Generic.IEnumerable`1" /> whose elements are copied to the new <see cref="T:System.Collections.Generic.Dictionary`2" />.</param>
575+
<param name="comparer">The <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> implementation to use when comparing keys, or <see langword="null" /> to use the default <see cref="T:System.Collections.Generic.EqualityComparer`1" /> for the type of the key.</param>
576+
<summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2" /> class that contains elements copied from the specified <see cref="T:System.Collections.Generic.IEnumerable`1" /> and uses the specified <see cref="T:System.Collections.Generic.IEqualityComparer`1" />.</summary>
573577
<remarks>To be added.</remarks>
578+
<exception cref="T:System.ArgumentNullException">
579+
<paramref name="collection" /> is <see langword="null" />.</exception>
580+
<exception cref="T:System.ArgumentException">
581+
<paramref name="collection" /> contains one or more duplicated keys.</exception>
574582
</Docs>
575583
</Member>
576584
<Member MemberName=".ctor">
@@ -1506,11 +1514,14 @@
15061514
<Parameter Name="value" Type="TValue" RefType="out" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0" />
15071515
</Parameters>
15081516
<Docs>
1509-
<param name="key">To be added.</param>
1510-
<param name="value">To be added.</param>
1511-
<summary>To be added.</summary>
1512-
<returns>To be added.</returns>
1517+
<param name="key">The key of the element to remove.</param>
1518+
<param name="value">The removed element.</param>
1519+
<summary>Removes the value with the specified key from the <see cref="T:System.Collections.Generic.Dictionary`2" />, and copies the element to the <paramref name="value" /> parameter.</summary>
1520+
<returns>
1521+
<see langword="true" /> if the element is successfully found and removed; otherwise, <see langword="false" />.</returns>
15131522
<remarks>To be added.</remarks>
1523+
<exception cref="T:System.ArgumentNullException">
1524+
<paramref name="key" /> is <see langword="null" />.</exception>
15141525
</Docs>
15151526
</Member>
15161527
<Member MemberName="System.Collections.Generic.ICollection&lt;System.Collections.Generic.KeyValuePair&lt;TKey,TValue&gt;&gt;.Add">

xml/System.Collections.Generic/KeyValuePair`2.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="KeyValuePair&lt;TKey,TValue&gt;" FullName="System.Collections.Generic.KeyValuePair&lt;TKey,TValue&gt;">
1+
<Type Name="KeyValuePair&lt;TKey,TValue&gt;" FullName="System.Collections.Generic.KeyValuePair&lt;TKey,TValue&gt;">
22
<TypeSignature Language="C#" Value="public struct KeyValuePair&lt;TKey,TValue&gt;" />
33
<TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit KeyValuePair`2&lt;TKey, TValue&gt; extends System.ValueType" FrameworkAlternate="dotnet-uwp-10.0;net-5.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;netstandard-2.1" />
44
<TypeSignature Language="DocId" Value="T:System.Collections.Generic.KeyValuePair`2" />
@@ -159,9 +159,9 @@
159159
<Parameter Name="value" Type="TValue" RefType="out" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0" />
160160
</Parameters>
161161
<Docs>
162-
<param name="key">To be added.</param>
163-
<param name="value">To be added.</param>
164-
<summary>To be added.</summary>
162+
<param name="key">The key of the current <see cref="T:System.Collections.Generic.KeyValuePair`2" />.</param>
163+
<param name="value">The value of the current <see cref="T:System.Collections.Generic.KeyValuePair`2" />.</param>
164+
<summary>Deconstructs the current <see cref="T:System.Collections.Generic.KeyValuePair`2" />.</summary>
165165
<remarks>To be added.</remarks>
166166
</Docs>
167167
</Member>

xml/System.Collections.Generic/Queue`1.xml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="Queue&lt;T&gt;" FullName="System.Collections.Generic.Queue&lt;T&gt;">
1+
<Type Name="Queue&lt;T&gt;" FullName="System.Collections.Generic.Queue&lt;T&gt;">
22
<TypeSignature Language="C#" Value="public class Queue&lt;T&gt; : System.Collections.Generic.IEnumerable&lt;T&gt;, System.Collections.Generic.IReadOnlyCollection&lt;T&gt;, System.Collections.ICollection" FrameworkAlternate="dotnet-uwp-10.0;net-5.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
33
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Queue`1&lt;T&gt; extends System.Object implements class System.Collections.Generic.IEnumerable`1&lt;!T&gt;, class System.Collections.Generic.IReadOnlyCollection`1&lt;!T&gt;, class System.Collections.ICollection, class System.Collections.IEnumerable" FrameworkAlternate="dotnet-uwp-10.0;net-5.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1" />
44
<TypeSignature Language="DocId" Value="T:System.Collections.Generic.Queue`1" />
@@ -1333,10 +1333,13 @@ finally {
13331333
<Parameter Name="result" Type="T" RefType="out" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0" />
13341334
</Parameters>
13351335
<Docs>
1336-
<param name="result">To be added.</param>
1337-
<summary>To be added.</summary>
1338-
<returns>To be added.</returns>
1336+
<param name="result">The removed object.</param>
1337+
<summary>Removes the object at the beginning of the <see cref="T:System.Collections.Generic.Queue`1" />, and copies it to the <paramref name="result" /> parameter.</summary>
1338+
<returns>
1339+
<see langword="true" /> if the object is successfully removed; <see langword="false" /> if the <see cref="T:System.Collections.Generic.Queue`1" /> is empty.</returns>
13391340
<remarks>To be added.</remarks>
1341+
<exception cref="T:System.ArgumentNullException">
1342+
<paramref name="key" /> is <see langword="null" />.</exception>
13401343
</Docs>
13411344
</Member>
13421345
<Member MemberName="TryPeek">
@@ -1368,9 +1371,10 @@ finally {
13681371
<Parameter Name="result" Type="T" RefType="out" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0" />
13691372
</Parameters>
13701373
<Docs>
1371-
<param name="result">To be added.</param>
1372-
<summary>To be added.</summary>
1373-
<returns>To be added.</returns>
1374+
<param name="result">If present, the object at the beginning of the <see cref="T:System.Collections.Generic.Queue`1" />; otherwise, the default value of <typeparamref name="T" />.</param>
1375+
<summary>Returns a value that indicates whether there is an object at the beginning of the <see cref="T:System.Collections.Generic.Queue`1" />, and if one is present, copies it to the <paramref name="result" /> parameter. The object is not removed from the <see cref="T:System.Collections.Generic.Queue`1" />.</summary>
1376+
<returns>
1377+
<see langword="true" /> if there is an object at the beginning of the <see cref="T:System.Collections.Generic.Queue`1" />; <see langword="false" /> if the <see cref="T:System.Collections.Generic.Queue`1" /> is empty.</returns>
13741378
<remarks>To be added.</remarks>
13751379
</Docs>
13761380
</Member>

xml/System.Collections.Generic/ReferenceEqualityComparer.xml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="ReferenceEqualityComparer" FullName="System.Collections.Generic.ReferenceEqualityComparer">
1+
<Type Name="ReferenceEqualityComparer" FullName="System.Collections.Generic.ReferenceEqualityComparer">
22
<TypeSignature Language="C#" Value="public sealed class ReferenceEqualityComparer : System.Collections.Generic.IEqualityComparer&lt;object&gt;, System.Collections.IEqualityComparer" />
33
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ReferenceEqualityComparer extends System.Object implements class System.Collections.Generic.IEqualityComparer`1&lt;object&gt;, class System.Collections.IEqualityComparer" />
44
<TypeSignature Language="DocId" Value="T:System.Collections.Generic.ReferenceEqualityComparer" />
@@ -21,8 +21,16 @@
2121
</Interface>
2222
</Interfaces>
2323
<Docs>
24-
<summary>To be added.</summary>
25-
<remarks>To be added.</remarks>
24+
<summary>An <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> that uses reference equality (<see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" />) instead of value equality (<see cref="M:System.Object.Equals(System.Object)" />) when comparing two object instances.</summary>
25+
<remarks>
26+
<format type="text/markdown"><![CDATA[
27+
28+
## Remarks
29+
30+
The <xref:System.Collections.Generic.ReferenceEqualityComparer> type cannot be instantiated. Instead, use the <xref:System.Collections.Generic.ReferenceEqualityComparer.Instance> property to access the singleton instance of this type.
31+
32+
]]></format>
33+
</remarks>
2634
</Docs>
2735
<Members>
2836
<Member MemberName="Equals">
@@ -49,11 +57,21 @@
4957
<Parameter Name="y" Type="System.Object" />
5058
</Parameters>
5159
<Docs>
52-
<param name="x">To be added.</param>
53-
<param name="y">To be added.</param>
54-
<summary>To be added.</summary>
55-
<returns>To be added.</returns>
56-
<remarks>To be added.</remarks>
60+
<param name="x">The first object to compare.</param>
61+
<param name="y">The second object to compare.</param>
62+
<summary>Determines whether two object references refer to the same object instance.</summary>
63+
<returns>
64+
<see langword="true" /> if both <paramref name="x" /> and <paramref name="y" /> refer to the same object instance or if both are <see langword="null" />; otherwise, <see langword="false" />.</returns>
65+
<remarks>
66+
<format type="text/markdown"><![CDATA[
67+
68+
## Remarks
69+
70+
This API is a wrapper around <xref:System.Object.ReferenceEquals(System.Object,System.Object)>.
71+
It is not necessarily equivalent to calling <xref:System.Object.Equals(System.Object,System.Object)>.
72+
73+
]]></format>
74+
</remarks>
5775
</Docs>
5876
</Member>
5977
<Member MemberName="GetHashCode">
@@ -79,10 +97,19 @@
7997
<Parameter Name="obj" Type="System.Object" />
8098
</Parameters>
8199
<Docs>
82-
<param name="obj">To be added.</param>
83-
<summary>To be added.</summary>
84-
<returns>To be added.</returns>
85-
<remarks>To be added.</remarks>
100+
<param name="obj">The object for which to retrieve the hash code.</param>
101+
<summary>Returns a hash code for the specified object. The returned hash code is based on the object identity, not on the contents of the object.</summary>
102+
<returns>A hash code for the identity of <paramref name="obj" />.</returns>
103+
<remarks>
104+
<format type="text/markdown"><![CDATA[
105+
106+
## Remarks
107+
108+
This API is a wrapper around <xref:System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(System.Object)>.
109+
It is not necessarily equivalent to calling <xref:System.Object.GetHashCode>.
110+
111+
]]></format>
112+
</remarks>
86113
</Docs>
87114
</Member>
88115
<Member MemberName="Instance">
@@ -101,7 +128,7 @@
101128
<ReturnType>System.Collections.Generic.ReferenceEqualityComparer</ReturnType>
102129
</ReturnValue>
103130
<Docs>
104-
<summary>To be added.</summary>
131+
<summary>Gets the singleton <see cref="T:System.Collections.Generic.ReferenceEqualityComparer" /> instance.</summary>
105132
<value>To be added.</value>
106133
<remarks>To be added.</remarks>
107134
</Docs>

xml/System.Collections.Generic/Stack`1.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="Stack&lt;T&gt;" FullName="System.Collections.Generic.Stack&lt;T&gt;">
1+
<Type Name="Stack&lt;T&gt;" FullName="System.Collections.Generic.Stack&lt;T&gt;">
22
<TypeSignature Language="C#" Value="public class Stack&lt;T&gt; : System.Collections.Generic.IEnumerable&lt;T&gt;, System.Collections.Generic.IReadOnlyCollection&lt;T&gt;, System.Collections.ICollection" FrameworkAlternate="dotnet-uwp-10.0;net-5.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
33
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Stack`1&lt;T&gt; extends System.Object implements class System.Collections.Generic.IEnumerable`1&lt;!T&gt;, class System.Collections.Generic.IReadOnlyCollection`1&lt;!T&gt;, class System.Collections.ICollection, class System.Collections.IEnumerable" FrameworkAlternate="dotnet-uwp-10.0;net-5.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1" />
44
<TypeSignature Language="DocId" Value="T:System.Collections.Generic.Stack`1" />
@@ -1367,9 +1367,10 @@ finally {
13671367
<Parameter Name="result" Type="T" RefType="out" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0" />
13681368
</Parameters>
13691369
<Docs>
1370-
<param name="result">To be added.</param>
1371-
<summary>To be added.</summary>
1372-
<returns>To be added.</returns>
1370+
<param name="result">If present, the object at the top of the <see cref="T:System.Collections.Generic.Stack`1" />; otherwise, the default value of <typeparamref name="T" />.</param>
1371+
<summary>Returns a value that indicates whether there is an object at the top of the <see cref="T:System.Collections.Generic.Stack`1" />, and if one is present, copies it to the <paramref name="result" /> parameter. The object is not removed from the <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
1372+
<returns>
1373+
<see langword="true" /> if there is an object at the top of the <see cref="T:System.Collections.Generic.Stack`1" />; <see langword="false" /> if the <see cref="T:System.Collections.Generic.Stack`1" /> is empty.</returns>
13731374
<remarks>To be added.</remarks>
13741375
</Docs>
13751376
</Member>
@@ -1402,9 +1403,10 @@ finally {
14021403
<Parameter Name="result" Type="T" RefType="out" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0" />
14031404
</Parameters>
14041405
<Docs>
1405-
<param name="result">To be added.</param>
1406-
<summary>To be added.</summary>
1407-
<returns>To be added.</returns>
1406+
<param name="result">If present, the object at the top of the <see cref="T:System.Collections.Generic.Stack`1" />; otherwise, the default value of <typeparamref name="T" />.</param>
1407+
<summary>Returns a value that indicates whether there is an object at the top of the <see cref="T:System.Collections.Generic.Stack`1" />, and if one is present, copies it to the <paramref name="result" /> parameter, and removes it from the <see cref="T:System.Collections.Generic.Stack`1" />.</summary>
1408+
<returns>
1409+
<see langword="true" /> if there is an object at the top of the <see cref="T:System.Collections.Generic.Stack`1" />; <see langword="false" /> if the <see cref="T:System.Collections.Generic.Stack`1" /> is empty.</returns>
14081410
<remarks>To be added.</remarks>
14091411
</Docs>
14101412
</Member>

0 commit comments

Comments
 (0)