Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions xml/System.Collections.Specialized/OrderedDictionary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@
## Examples
The following code example demonstrates the creation, population and modification of an <xref:System.Collections.Specialized.OrderedDictionary> collection, as well as two techniques to display the contents of the <xref:System.Collections.Specialized.OrderedDictionary>: one using the <xref:System.Collections.Specialized.OrderedDictionary.Keys%2A> and <xref:System.Collections.Specialized.OrderedDictionary.Values%2A> properties and the other creating an enumerator through the <xref:System.Collections.Specialized.OrderedDictionary.GetEnumerator%2A> method.

[!code-cpp[System.Collections.Specialized.OrderedDictionary1#00](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/cpp/ordereddictionary1.cpp#00)]
[!code-csharp[System.Collections.Specialized.OrderedDictionary1#00](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/CS/OrderedDictionary1.cs#00)]
[!code-vb[System.Collections.Specialized.OrderedDictionary1#00](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/VB/OrderedDictionary1.vb#00)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/cpp/ordereddictionary1.cpp" id="Snippet00":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/CS/OrderedDictionary1.cs" interactive="try-dotnet" id="Snippet00":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/VB/OrderedDictionary1.vb" id="Snippet00":::

]]></format>
</remarks>
</Docs>
Expand Down
8 changes: 4 additions & 4 deletions xml/System.Globalization/DateTimeFormatInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3050,10 +3050,10 @@ The default array starts on Sunday.
## Examples
The following example displays the value of <xref:System.Globalization.DateTimeFormatInfo.ShortTimePattern%2A> for a few cultures.

[!code-cpp[System.Globalization.DateTimeFormatInfo.ShortTimePattern#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/CPP/dtfi_shorttimepattern.cpp#1)]
[!code-csharp[System.Globalization.DateTimeFormatInfo.ShortTimePattern#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/CS/dtfi_shorttimepattern.cs#1)]
[!code-vb[System.Globalization.DateTimeFormatInfo.ShortTimePattern#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/VB/dtfi_shorttimepattern.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/CPP/dtfi_shorttimepattern.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/CS/dtfi_shorttimepattern.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/VB/dtfi_shorttimepattern.vb" id="Snippet1":::

]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The property is being set to <see langword="null" />.</exception>
Expand Down
8 changes: 4 additions & 4 deletions xml/System.Globalization/NumberFormatInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1767,10 +1767,10 @@

## Examples
The following example demonstrates the effect of changing the <xref:System.Globalization.NumberFormatInfo.NumberGroupSeparator%2A> property.
[!code-cpp[NumberGroupSeparator#1](~/samples/snippets/cpp/VS_Snippets_CLR/NumberGroupSeparator/CPP/numbergroupseparator.cpp#1)]
[!code-csharp[NumberGroupSeparator#1](~/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSeparator/CS/numbergroupseparator.cs#1)]
[!code-vb[NumberGroupSeparator#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/NumberGroupSeparator/VB/numbergroupseparator.vb#1)]

:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/NumberGroupSeparator/CPP/numbergroupseparator.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSeparator/CS/numbergroupseparator.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/NumberGroupSeparator/VB/numbergroupseparator.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down
6 changes: 3 additions & 3 deletions xml/System.Security.Cryptography/KeyedHashAlgorithm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@

## Examples
The following code example demonstrates how to derive from the <xref:System.Security.Cryptography.KeyedHashAlgorithm> class.
[!code-csharp[KeyedHashAlgorithm#1](~/samples/snippets/csharp/VS_Snippets_CLR/keyedhashalgorithm/cs/program.cs#1)]
[!code-vb[KeyedHashAlgorithm#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/keyedhashalgorithm/vb/program.vb#1)]

:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/keyedhashalgorithm/cs/program.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/keyedhashalgorithm/vb/program.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down
20 changes: 10 additions & 10 deletions xml/System.Text/Encoding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2970,10 +2970,10 @@ On .NET Core, the <xref:System.Text.Encoding.Default%2A> property always returns
## Examples
The following example encodes a string into an array of bytes, and then decodes the bytes into an array of characters.

[!code-cpp[System.Text.Encoding.GetChars#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CPP/getchars.cpp#1)]
[!code-csharp[System.Text.Encoding.GetChars#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CS/getchars.cs#1)]
[!code-vb[System.Text.Encoding.GetChars#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/VB/getchars.vb#1)]

:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CPP/getchars.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CS/getchars.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/VB/getchars.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
Expand Down Expand Up @@ -3127,9 +3127,9 @@ On .NET Core, the <xref:System.Text.Encoding.Default%2A> property always returns
## Examples
The following example encodes a string into an array of bytes, and then decodes a range of the bytes into an array of characters.

[!code-cpp[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CPP/getcharsic.cpp#1)]
[!code-csharp[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CS/getcharsic.cs#1)]
[!code-vb[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/VB/getcharsic.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CPP/getcharsic.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CS/getcharsic.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/VB/getcharsic.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -3349,9 +3349,9 @@ On .NET Core, the <xref:System.Text.Encoding.Default%2A> property always returns

The following example encodes a string into an array of bytes, and then decodes a range of the bytes into an array of characters.

[!code-cpp[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CPP/getcharsic.cpp#1)]
[!code-csharp[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CS/getcharsic.cs#1)]
[!code-vb[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/VB/getcharsic.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CPP/getcharsic.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CS/getcharsic.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/VB/getcharsic.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down
6 changes: 3 additions & 3 deletions xml/System.Text/StringBuilder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3709,9 +3709,9 @@

<xref:System.Text.StringBuilder.Chars%2A> is the default property of the <xref:System.Text.StringBuilder> class. In C#, it is an indexer. This means that individual characters can be retrieved from the <xref:System.Text.StringBuilder.Chars%2A> property as shown in the following example, which counts the number of alphabetic, white-space, and punctuation characters in a string.

[!code-csharp[System.Text.StringBuilder.Chars#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.stringbuilder.chars/cs/chars1.cs#1)]
[!code-vb[System.Text.StringBuilder.Chars#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.stringbuilder.chars/vb/chars1.vb#1)]

:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.stringbuilder.chars/cs/chars1.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.stringbuilder.chars/vb/chars1.vb" id="Snippet1":::
### Performance and character-based indexing

[!INCLUDE[stringbuilder-performance-note](~/includes/stringbuilder-perf-note.md)]
Expand Down
8 changes: 4 additions & 4 deletions xml/System/Buffer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@

## Examples
The following code example illustrates the use of the `ByteLength` method to return the number of bytes in an array.
[!code-cpp[System.Buffer.Bytes#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.Bytes/CPP/bytelength.cpp#1)]
[!code-csharp[System.Buffer.Bytes#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/bytelength.cs#1)]
[!code-vb[System.Buffer.Bytes#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.Bytes/VB/bytelength.vb#1)]

:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.Bytes/CPP/bytelength.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/bytelength.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.Bytes/VB/bytelength.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down
18 changes: 9 additions & 9 deletions xml/System/Double.xml
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,9 @@
## Remarks
Values must be identical to be considered equal. Particularly when floating-point values depend on multiple mathematical operations, it is common for them to lose precision and for their values to be nearly identical except for their least significant digits. Because of this, the return value of the <xref:System.Double.CompareTo%2A> method at times may seem surprising. For example, multiplication by a particular value followed by division by the same value should produce the original value. In the following example, however, the computed value turns out to be greater than the original value. Showing all significant digits of the two values by using the "R" [standard numeric format string](/dotnet/standard/base-types/standard-numeric-format-strings) indicates that the computed value differs from the original value in its least significant digits. For information on handling such comparisons, see the Remarks section of the <xref:System.Double.Equals%28System.Double%29> method.

[!code-csharp[System.Double.CompareTo#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto2.cs#1)]
[!code-vb[System.Double.CompareTo#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.double.compareto/vb/compareto2.vb#1)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto2.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.double.compareto/vb/compareto2.vb" id="Snippet1":::

This method implements the <xref:System.IComparable%601?displayProperty=nameWithType> interface and performs slightly better than the <xref:System.Double.CompareTo%2A?displayProperty=nameWithType> method because it does not have to convert the `value` parameter to an object.

Note that, although an object whose value is <xref:System.Double.NaN> is not considered equal to another object whose value is <xref:System.Double.NaN> (even itself), the <xref:System.IComparable%601> interface requires that `A.CompareTo(A)` return zero.
Expand All @@ -404,9 +404,9 @@
## Examples
The following code example demonstrates generic and nongeneric versions of the <xref:System.Double.CompareTo%2A> method for several value and reference types.

[!code-cpp[T.CompareTo#1](~/samples/snippets/cpp/VS_Snippets_CLR/T.CompareTo/CPP/cat.cpp#1)]
[!code-csharp[T.CompareTo#1](~/samples/snippets/csharp/VS_Snippets_CLR/T.CompareTo/CS/cat.cs#1)]
[!code-vb[T.CompareTo#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/T.CompareTo/VB/cat.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/T.CompareTo/CPP/cat.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/T.CompareTo/CS/cat.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/T.CompareTo/VB/cat.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -475,9 +475,9 @@

Values must be identical to be considered equal. Particularly when floating-point values depend on multiple mathematical operations, it is common for them to lose precision and for their values to be nearly identical except for their least significant digits. Because of this, the return value of the <xref:System.Double.CompareTo%2A> method at times may seem surprising. For example, multiplication by a particular value followed by division by the same value should produce the original value. In the following example, however, the computed value turns out to be greater than the original value. Showing all significant digits of the two values by using the "R" [standard numeric format string](/dotnet/standard/base-types/standard-numeric-format-strings) indicates that the computed value differs from the original value in its least significant digits. For information on handling such comparisons, see the Remarks section of the <xref:System.Double.Equals%28System.Double%29> method.

[!code-csharp[System.Double.CompareTo#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto3.cs#2)]
[!code-vb[System.Double.CompareTo#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.double.compareto/vb/compareto3.vb#2)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto3.cs" interactive="try-dotnet" id="Snippet2":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.double.compareto/vb/compareto3.vb" id="Snippet2":::

This method is implemented to support the <xref:System.IComparable> interface. Note that, although a <xref:System.Double.NaN> is not considered to be equal to another <xref:System.Double.NaN> (even itself), the <xref:System.IComparable> interface requires that `A.CompareTo(A)` return zero.

## Precision in Comparisons
Expand Down
8 changes: 4 additions & 4 deletions xml/System/TimeSpan.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1610,10 +1610,10 @@
## Examples
The following example creates several <xref:System.TimeSpan> objects using the <xref:System.TimeSpan.FromTicks%2A> method.

[!code-cpp[System.TimeSpan.From#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.From/CPP/fromticks.cpp#1)]
[!code-csharp[System.TimeSpan.From#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.From/CS/fromticks.cs#1)]
[!code-vb[System.TimeSpan.From#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.From/VB/fromticks.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.From/CPP/fromticks.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.From/CS/fromticks.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.From/VB/fromticks.vb" id="Snippet1":::

]]></format>
</remarks>
<altmember cref="T:System.Int64" />
Expand Down
8 changes: 4 additions & 4 deletions xml/System/Uri.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3179,10 +3179,10 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce

## Examples
The following example creates a <xref:System.Uri> instance and determines whether it is a UNC path.
[!code-cpp[NCLUriExamples#6](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp#6)]
[!code-csharp[NCLUriExamples#6](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs#6)]
[!code-vb[NCLUriExamples#6](~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb#6)]

:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp" id="Snippet6":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs" interactive="try-dotnet-method" id="Snippet6":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb" id="Snippet6":::

]]></format>
</remarks>
Expand Down