Skip to content

Commit d5fbb25

Browse files
authored
Automatic port of System.Globalization documentation (#4699)
* Automatic port of System.Globalization documentation * Apply suggestions from code review Co-authored-by: carlossanlop <[email protected]>
1 parent b36b257 commit d5fbb25

File tree

2 files changed

+90
-55
lines changed

2 files changed

+90
-55
lines changed

xml/System.Globalization/CompareInfo.xml

Lines changed: 87 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="CompareInfo" FullName="System.Globalization.CompareInfo">
1+
<Type Name="CompareInfo" FullName="System.Globalization.CompareInfo">
22
<TypeSignature Language="C#" Value="public class CompareInfo" 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 CompareInfo extends System.Object" 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.Globalization.CompareInfo" />
@@ -256,12 +256,14 @@
256256
<Parameter Name="options" Type="System.Globalization.CompareOptions" Index="2" FrameworkAlternate="net-5.0" />
257257
</Parameters>
258258
<Docs>
259-
<param name="string1">To be added.</param>
260-
<param name="string2">To be added.</param>
261-
<param name="options">To be added.</param>
262-
<summary>To be added.</summary>
263-
<returns>To be added.</returns>
259+
<param name="string1">The first read-only span of characters to compare.</param>
260+
<param name="string2">The second read-only span of characters to compare.</param>
261+
<param name="options">An optional combination of <see cref="T:System.Globalization.CompareOptions" /> enumeration values to use during the comparison. The default value is <see cref="F:System.Globalization.CompareOptions.None" />.</param>
262+
<summary>Compares two read-only spans of characters.</summary>
263+
<returns>Zero if <paramref name="string1" /> and <paramref name="string2" /> are equal; or a negative value if <paramref name="string1" /> sorts before <paramref name="string2" />; or a positive value if <paramref name="string1" /> sorts after <paramref name="string2" />.</returns>
264264
<remarks>To be added.</remarks>
265+
<exception cref="T:System.ArgumentException">
266+
<paramref name="options" /> contains an unsupported combination of flags.</exception>
265267
</Docs>
266268
</Member>
267269
<Member MemberName="Compare">
@@ -1516,12 +1518,23 @@
15161518
<Parameter Name="options" Type="System.Globalization.CompareOptions" Index="2" FrameworkAlternate="net-5.0" />
15171519
</Parameters>
15181520
<Docs>
1519-
<param name="source">To be added.</param>
1520-
<param name="destination">To be added.</param>
1521-
<param name="options">To be added.</param>
1522-
<summary>To be added.</summary>
1523-
<returns>To be added.</returns>
1524-
<remarks>To be added.</remarks>
1521+
<param name="source">The text to get the sort key for.</param>
1522+
<param name="destination">The buffer into which the resulting sort key bytes are stored.</param>
1523+
<param name="options">An optional combination of <see cref="T:System.Globalization.CompareOptions" /> enumeration values to use for computing the sort key. The default value is <see cref="F:System.Globalization.CompareOptions.None" />.</param>
1524+
<summary>Computes a sort key for the specified input.</summary>
1525+
<returns>The number of bytes written to <paramref name="destination" />.</returns>
1526+
<remarks>
1527+
<format type="text/markdown"><![CDATA[
1528+
1529+
## Remarks
1530+
1531+
Use <xref:System.Globalization.CompareInfo.GetSortKeyLength(System.ReadOnlySpan{System.Char},System.Globalization.CompareOptions)> to query the required size of `destination`.
1532+
It is acceptable to provide a larger-than-necessary output buffer to this method.
1533+
1534+
]]></format>
1535+
</remarks>
1536+
<exception cref="T:System.ArgumentException">
1537+
<paramref name="destination" /> is too small to contain the resulting sort key; or <paramref name="options" /> contains an unsupported flag; or <paramref name="source" /> cannot be processed using the desired <see cref="T:System.Globalization.CompareOptions" /> under the current <see cref="T:System.Globalization.CompareInfo" />.</exception>
15251538
</Docs>
15261539
</Member>
15271540
<Member MemberName="GetSortKeyLength">
@@ -1552,11 +1565,17 @@
15521565
<Parameter Name="options" Type="System.Globalization.CompareOptions" Index="1" FrameworkAlternate="net-5.0" />
15531566
</Parameters>
15541567
<Docs>
1555-
<param name="source">To be added.</param>
1556-
<param name="options">To be added.</param>
1557-
<summary>To be added.</summary>
1558-
<returns>To be added.</returns>
1568+
<param name="source">The text to get the sort key for.</param>
1569+
<param name="options">An optional combination of <see cref="T:System.Globalization.CompareOptions" /> enumeration values to use for computing the sort key. The default value is <see cref="F:System.Globalization.CompareOptions.None" />.</param>
1570+
<summary>Gets the total number of sort key bytes that would be produced from the specified input.</summary>
1571+
<returns>The length, in bytes, of the sort key.</returns>
15591572
<remarks>To be added.</remarks>
1573+
<exception cref="T:System.ArgumentException">
1574+
<paramref name="options" /> contains an unsupported flag.
1575+
1576+
-or-
1577+
1578+
<paramref name="source" /> cannot be processed using the desired <see cref="T:System.Globalization.CompareOptions" /> under the current <see cref="T:System.Globalization.CompareInfo" />.</exception>
15601579
</Docs>
15611580
</Member>
15621581
<MemberGroup MemberName="IndexOf">
@@ -1767,12 +1786,14 @@
17671786
<Parameter Name="options" Type="System.Globalization.CompareOptions" Index="2" FrameworkAlternate="net-5.0" />
17681787
</Parameters>
17691788
<Docs>
1770-
<param name="source">To be added.</param>
1771-
<param name="value">To be added.</param>
1772-
<param name="options">To be added.</param>
1773-
<summary>To be added.</summary>
1774-
<returns>To be added.</returns>
1789+
<param name="source">The string to search within.</param>
1790+
<param name="value">The substring to locate within <paramref name="source" />.</param>
1791+
<param name="options">An optional combination of <see cref="T:System.Globalization.CompareOptions" /> enumeration values to use during the search. The default value is <see cref="F:System.Globalization.CompareOptions.None" />.</param>
1792+
<summary>Searches for the first occurrence of a substring within the specified read-only span of characters.</summary>
1793+
<returns>The zero-based index into <paramref name="source" /> where the substring <paramref name="value" /> first appears; or a negative value if <paramref name="value" /> cannot be found within <paramref name="source" />.</returns>
17751794
<remarks>To be added.</remarks>
1795+
<exception cref="T:System.ArgumentException">
1796+
<paramref name="options" /> contains an unsupported combination of flags.</exception>
17761797
</Docs>
17771798
</Member>
17781799
<Member MemberName="IndexOf">
@@ -1804,12 +1825,14 @@
18041825
<Parameter Name="options" Type="System.Globalization.CompareOptions" Index="2" FrameworkAlternate="net-5.0" />
18051826
</Parameters>
18061827
<Docs>
1807-
<param name="source">To be added.</param>
1808-
<param name="value">To be added.</param>
1809-
<param name="options">To be added.</param>
1810-
<summary>To be added.</summary>
1811-
<returns>To be added.</returns>
1828+
<param name="source">The read-only span of characters to search within.</param>
1829+
<param name="value">The <see cref="T:System.Text.Rune" /> to locate within <paramref name="source" />.</param>
1830+
<param name="options">An optional combination of <see cref="T:System.Globalization.CompareOptions" /> enumeration values to use during the search. The default value is <see cref="F:System.Globalization.CompareOptions.None" />.</param>
1831+
<summary>Searches for the first occurrence of a <see cref="T:System.Text.Rune" /> within the specified read-only span of characters.</summary>
1832+
<returns>The zero-based index into <paramref name="source" /> where <paramref name="value" /> first appears; or a negative value if <paramref name="value" /> cannot be found within <paramref name="source" />.</returns>
18121833
<remarks>To be added.</remarks>
1834+
<exception cref="T:System.ArgumentException">
1835+
<paramref name="options" /> contains an unsupported combination of flags.</exception>
18131836
</Docs>
18141837
</Member>
18151838
<Member MemberName="IndexOf">
@@ -2900,12 +2923,15 @@
29002923
<Parameter Name="options" Type="System.Globalization.CompareOptions" Index="2" FrameworkAlternate="net-5.0" />
29012924
</Parameters>
29022925
<Docs>
2903-
<param name="source">To be added.</param>
2904-
<param name="prefix">To be added.</param>
2905-
<param name="options">To be added.</param>
2906-
<summary>To be added.</summary>
2907-
<returns>To be added.</returns>
2926+
<param name="source">The read-only span of characters to search within.</param>
2927+
<param name="prefix">The prefix to attempt to match at the start of <paramref name="source" />.</param>
2928+
<param name="options">An optional combination of <see cref="T:System.Globalization.CompareOptions" /> enumeration values to use during the match. The default value is <see cref="F:System.Globalization.CompareOptions.None" />.</param>
2929+
<summary>Determines whether a read-only span of characters starts with a specific prefix.</summary>
2930+
<returns>
2931+
<see langword="true" /> if <paramref name="prefix" /> occurs at the start of <paramref name="source" />; otherwise, <see langword="false" />.</returns>
29082932
<remarks>To be added.</remarks>
2933+
<exception cref="T:System.ArgumentException">
2934+
<paramref name="options" /> contains an unsupported combination of flags.</exception>
29092935
</Docs>
29102936
</Member>
29112937
<Member MemberName="IsPrefix">
@@ -3094,9 +3120,10 @@
30943120
<Parameter Name="text" Type="System.ReadOnlySpan&lt;System.Char&gt;" Index="0" FrameworkAlternate="net-5.0" />
30953121
</Parameters>
30963122
<Docs>
3097-
<param name="text">To be added.</param>
3098-
<summary>To be added.</summary>
3099-
<returns>To be added.</returns>
3123+
<param name="text">A read-only span of characters of zero or more Unicode characters.</param>
3124+
<summary>Indicates whether a specified Unicode read-only span of characters is sortable.</summary>
3125+
<returns>
3126+
<see langword="true" /> if <paramref name="text" /> is non-empty and contains only sortable Unicode characters; otherwise, <see langword="false" />.</returns>
31003127
<remarks>To be added.</remarks>
31013128
</Docs>
31023129
</Member>
@@ -3190,9 +3217,10 @@
31903217
<Parameter Name="value" Type="System.Text.Rune" Index="0" FrameworkAlternate="net-5.0" />
31913218
</Parameters>
31923219
<Docs>
3193-
<param name="value">To be added.</param>
3194-
<summary>To be added.</summary>
3195-
<returns>To be added.</returns>
3220+
<param name="value">A Unicode scalar value.</param>
3221+
<summary>Indicates whether a specified <see cref="T:System.Text.Rune" /> is sortable.</summary>
3222+
<returns>
3223+
<see langword="true" /> if <paramref name="value" /> is a sortable Unicode scalar value; otherwise, <see langword="false" />.</returns>
31963224
<remarks>To be added.</remarks>
31973225
</Docs>
31983226
</Member>
@@ -3314,12 +3342,15 @@
33143342
<Parameter Name="options" Type="System.Globalization.CompareOptions" Index="2" FrameworkAlternate="net-5.0" />
33153343
</Parameters>
33163344
<Docs>
3317-
<param name="source">To be added.</param>
3318-
<param name="suffix">To be added.</param>
3319-
<param name="options">To be added.</param>
3320-
<summary>To be added.</summary>
3321-
<returns>To be added.</returns>
3345+
<param name="source">The read-only span of characters to search within.</param>
3346+
<param name="suffix">The suffix to attempt to match at the end of <paramref name="source" />.</param>
3347+
<param name="options">An optional combination of <see cref="T:System.Globalization.CompareOptions" /> enumeration values to use during the match. The default value is <see cref="F:System.Globalization.CompareOptions.None" />.</param>
3348+
<summary>Determines whether a read-only span of characters ends with a specific suffix.</summary>
3349+
<returns>
3350+
<see langword="true" /> if <paramref name="suffix" /> occurs at the end of <paramref name="source" />; otherwise, <see langword="false" />.</returns>
33223351
<remarks>To be added.</remarks>
3352+
<exception cref="T:System.ArgumentException">
3353+
<paramref name="options" /> contains an unsupported combination of flags.</exception>
33233354
</Docs>
33243355
</Member>
33253356
<Member MemberName="IsSuffix">
@@ -3627,12 +3658,14 @@
36273658
<Parameter Name="options" Type="System.Globalization.CompareOptions" Index="2" FrameworkAlternate="net-5.0" />
36283659
</Parameters>
36293660
<Docs>
3630-
<param name="source">To be added.</param>
3631-
<param name="value">To be added.</param>
3632-
<param name="options">To be added.</param>
3633-
<summary>To be added.</summary>
3634-
<returns>To be added.</returns>
3661+
<param name="source">The read-only span of characters to search within.</param>
3662+
<param name="value">The substring to locate within <paramref name="source" />.</param>
3663+
<param name="options">An optional combination of <see cref="T:System.Globalization.CompareOptions" /> enumeration values to use during the search. The default value is <see cref="F:System.Globalization.CompareOptions.None" />.</param>
3664+
<summary>Searches for the last occurrence of a substring within the specified read-only span of characters.</summary>
3665+
<returns>The zero-based index into <paramref name="source" /> where the substring <paramref name="value" /> last appears; or a negative value if <paramref name="value" /> cannot be found within <paramref name="source" />.</returns>
36353666
<remarks>To be added.</remarks>
3667+
<exception cref="T:System.ArgumentException">
3668+
<paramref name="options" /> contains an unsupported combination of flags.</exception>
36363669
</Docs>
36373670
</Member>
36383671
<Member MemberName="LastIndexOf">
@@ -3664,12 +3697,14 @@
36643697
<Parameter Name="options" Type="System.Globalization.CompareOptions" Index="2" FrameworkAlternate="net-5.0" />
36653698
</Parameters>
36663699
<Docs>
3667-
<param name="source">To be added.</param>
3668-
<param name="value">To be added.</param>
3669-
<param name="options">To be added.</param>
3670-
<summary>To be added.</summary>
3671-
<returns>To be added.</returns>
3700+
<param name="source">The read-only span of characters to search within.</param>
3701+
<param name="value">The <see cref="T:System.Text.Rune" /> to locate within <paramref name="source" />.</param>
3702+
<param name="options">An optional combination of <see cref="T:System.Globalization.CompareOptions" /> enumeration values to use during the search. The default value is <see cref="F:System.Globalization.CompareOptions.None" />.</param>
3703+
<summary>Searches for the last occurrence of a <see cref="T:System.Text.Rune" /> within the specified read-only span of characters.</summary>
3704+
<returns>The zero-based index into <paramref name="source" /> where <paramref name="value" /> last appears; or a negative value if <paramref name="value" /> cannot be found within <paramref name="source" />.</returns>
36723705
<remarks>To be added.</remarks>
3706+
<exception cref="T:System.ArgumentException">
3707+
<paramref name="options" /> contains an unsupported combination of flags.</exception>
36733708
</Docs>
36743709
</Member>
36753710
<Member MemberName="LastIndexOf">

xml/System.Globalization/DateTimeFormatInfo.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="DateTimeFormatInfo" FullName="System.Globalization.DateTimeFormatInfo">
1+
<Type Name="DateTimeFormatInfo" FullName="System.Globalization.DateTimeFormatInfo">
22
<TypeSignature Language="C#" Value="public sealed class DateTimeFormatInfo : IFormatProvider" 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 sealed beforefieldinit DateTimeFormatInfo extends System.Object implements class System.IFormatProvider" 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.Globalization.DateTimeFormatInfo" />
@@ -3156,8 +3156,8 @@ The default array starts on Sunday.
31563156
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" Index="1" FrameworkAlternate="netframework-1.1" />
31573157
</Parameters>
31583158
<Docs>
3159-
<param name="info">To be added.</param>
3160-
<param name="context">To be added.</param>
3159+
<param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> to populate with data.</param>
3160+
<param name="context">The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext" />) for this serialization.</param>
31613161
<summary>Populates a SerializationInfo with the data needed to serialize the target object.</summary>
31623162
<remarks>To be added.</remarks>
31633163
</Docs>

0 commit comments

Comments
 (0)