Skip to content

Commit f986185

Browse files
v-mepamairaw
andauthored
.NET Interactive: Enable_try_dotnet_to_batch_16a (#4549)
* enable_try_dotnet_to_batch_16a * reverting_back_to_old_sample * fix file extension * add missing sample * add missing sample * test to fix an issue * fix interactive mode Co-authored-by: Maira Wenzel <[email protected]>
1 parent e4ca4a5 commit f986185

File tree

10 files changed

+49
-49
lines changed

10 files changed

+49
-49
lines changed

xml/System.Collections.Specialized/OrderedDictionary.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@
9292
## Examples
9393
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.
9494
95-
[!code-cpp[System.Collections.Specialized.OrderedDictionary1#00](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/cpp/ordereddictionary1.cpp#00)]
96-
[!code-csharp[System.Collections.Specialized.OrderedDictionary1#00](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/CS/OrderedDictionary1.cs#00)]
97-
[!code-vb[System.Collections.Specialized.OrderedDictionary1#00](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/VB/OrderedDictionary1.vb#00)]
98-
95+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/cpp/ordereddictionary1.cpp" id="Snippet00":::
96+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/CS/OrderedDictionary1.cs" interactive="try-dotnet" id="Snippet00":::
97+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.OrderedDictionary1/VB/OrderedDictionary1.vb" id="Snippet00":::
98+
9999
]]></format>
100100
</remarks>
101101
</Docs>

xml/System.Globalization/DateTimeFormatInfo.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,10 +3050,10 @@ The default array starts on Sunday.
30503050
## Examples
30513051
The following example displays the value of <xref:System.Globalization.DateTimeFormatInfo.ShortTimePattern%2A> for a few cultures.
30523052
3053-
[!code-cpp[System.Globalization.DateTimeFormatInfo.ShortTimePattern#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/CPP/dtfi_shorttimepattern.cpp#1)]
3054-
[!code-csharp[System.Globalization.DateTimeFormatInfo.ShortTimePattern#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/CS/dtfi_shorttimepattern.cs#1)]
3055-
[!code-vb[System.Globalization.DateTimeFormatInfo.ShortTimePattern#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/VB/dtfi_shorttimepattern.vb#1)]
3056-
3053+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/CPP/dtfi_shorttimepattern.cpp" id="Snippet1":::
3054+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/CS/dtfi_shorttimepattern.cs" interactive="try-dotnet" id="Snippet1":::
3055+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortTimePattern/VB/dtfi_shorttimepattern.vb" id="Snippet1":::
3056+
30573057
]]></format>
30583058
</remarks>
30593059
<exception cref="T:System.ArgumentNullException">The property is being set to <see langword="null" />.</exception>

xml/System.Globalization/NumberFormatInfo.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,10 +1767,10 @@
17671767
17681768
## Examples
17691769
The following example demonstrates the effect of changing the <xref:System.Globalization.NumberFormatInfo.NumberGroupSeparator%2A> property.
1770-
1771-
[!code-cpp[NumberGroupSeparator#1](~/samples/snippets/cpp/VS_Snippets_CLR/NumberGroupSeparator/CPP/numbergroupseparator.cpp#1)]
1772-
[!code-csharp[NumberGroupSeparator#1](~/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSeparator/CS/numbergroupseparator.cs#1)]
1773-
[!code-vb[NumberGroupSeparator#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/NumberGroupSeparator/VB/numbergroupseparator.vb#1)]
1770+
1771+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/NumberGroupSeparator/CPP/numbergroupseparator.cpp" id="Snippet1":::
1772+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSeparator/CS/numbergroupseparator.cs" interactive="try-dotnet" id="Snippet1":::
1773+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/NumberGroupSeparator/VB/numbergroupseparator.vb" id="Snippet1":::
17741774
17751775
]]></format>
17761776
</remarks>

xml/System.Security.Cryptography/KeyedHashAlgorithm.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
5555
## Examples
5656
The following code example demonstrates how to derive from the <xref:System.Security.Cryptography.KeyedHashAlgorithm> class.
57-
58-
[!code-csharp[KeyedHashAlgorithm#1](~/samples/snippets/csharp/VS_Snippets_CLR/keyedhashalgorithm/cs/program.cs#1)]
59-
[!code-vb[KeyedHashAlgorithm#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/keyedhashalgorithm/vb/program.vb#1)]
57+
58+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/keyedhashalgorithm/cs/program.cs" interactive="try-dotnet" id="Snippet1":::
59+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/keyedhashalgorithm/vb/program.vb" id="Snippet1":::
6060
6161
]]></format>
6262
</remarks>

xml/System.Text/Encoding.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,10 +2970,10 @@ On .NET Core, the <xref:System.Text.Encoding.Default%2A> property always returns
29702970
## Examples
29712971
The following example encodes a string into an array of bytes, and then decodes the bytes into an array of characters.
29722972
2973-
[!code-cpp[System.Text.Encoding.GetChars#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CPP/getchars.cpp#1)]
2974-
[!code-csharp[System.Text.Encoding.GetChars#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CS/getchars.cs#1)]
2975-
[!code-vb[System.Text.Encoding.GetChars#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/VB/getchars.vb#1)]
2976-
2973+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CPP/getchars.cpp" id="Snippet1":::
2974+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CS/getchars.cs" interactive="try-dotnet" id="Snippet1":::
2975+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/VB/getchars.vb" id="Snippet1":::
2976+
29772977
]]></format>
29782978
</remarks>
29792979
<exception cref="T:System.ArgumentNullException">
@@ -3127,9 +3127,9 @@ On .NET Core, the <xref:System.Text.Encoding.Default%2A> property always returns
31273127
## Examples
31283128
The following example encodes a string into an array of bytes, and then decodes a range of the bytes into an array of characters.
31293129
3130-
[!code-cpp[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CPP/getcharsic.cpp#1)]
3131-
[!code-csharp[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CS/getcharsic.cs#1)]
3132-
[!code-vb[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/VB/getcharsic.vb#1)]
3130+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CPP/getcharsic.cpp" id="Snippet1":::
3131+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CS/getcharsic.cs" interactive="try-dotnet" id="Snippet1":::
3132+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/VB/getcharsic.vb" id="Snippet1":::
31333133
31343134
]]></format>
31353135
</remarks>
@@ -3349,9 +3349,9 @@ On .NET Core, the <xref:System.Text.Encoding.Default%2A> property always returns
33493349
33503350
The following example encodes a string into an array of bytes, and then decodes a range of the bytes into an array of characters.
33513351
3352-
[!code-cpp[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CPP/getcharsic.cpp#1)]
3353-
[!code-csharp[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CS/getcharsic.cs#1)]
3354-
[!code-vb[System.Text.Encoding.GetCharsIC#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/VB/getcharsic.vb#1)]
3352+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CPP/getcharsic.cpp" id="Snippet1":::
3353+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/CS/getcharsic.cs" interactive="try-dotnet" id="Snippet1":::
3354+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetCharsIC/VB/getcharsic.vb" id="Snippet1":::
33553355
33563356
]]></format>
33573357
</remarks>

xml/System.Text/StringBuilder.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3709,9 +3709,9 @@
37093709
37103710
<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.
37113711
3712-
[!code-csharp[System.Text.StringBuilder.Chars#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.stringbuilder.chars/cs/chars1.cs#1)]
3713-
[!code-vb[System.Text.StringBuilder.Chars#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.stringbuilder.chars/vb/chars1.vb#1)]
3714-
3712+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.stringbuilder.chars/cs/chars1.cs" interactive="try-dotnet" id="Snippet1":::
3713+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.stringbuilder.chars/vb/chars1.vb" id="Snippet1":::
3714+
37153715
### Performance and character-based indexing
37163716
37173717
[!INCLUDE[stringbuilder-performance-note](~/includes/stringbuilder-perf-note.md)]

xml/System/Buffer.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@
224224
225225
## Examples
226226
The following code example illustrates the use of the `ByteLength` method to return the number of bytes in an array.
227-
228-
[!code-cpp[System.Buffer.Bytes#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.Bytes/CPP/bytelength.cpp#1)]
229-
[!code-csharp[System.Buffer.Bytes#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/bytelength.cs#1)]
230-
[!code-vb[System.Buffer.Bytes#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.Bytes/VB/bytelength.vb#1)]
227+
228+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.Bytes/CPP/bytelength.cpp" id="Snippet1":::
229+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/bytelength.cs" interactive="try-dotnet" id="Snippet1":::
230+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.Bytes/VB/bytelength.vb" id="Snippet1":::
231231
232232
]]></format>
233233
</remarks>

xml/System/Double.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@
382382
## Remarks
383383
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.
384384
385-
[!code-csharp[System.Double.CompareTo#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto2.cs#1)]
386-
[!code-vb[System.Double.CompareTo#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.double.compareto/vb/compareto2.vb#1)]
387-
385+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto2.cs" interactive="try-dotnet" id="Snippet1":::
386+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.double.compareto/vb/compareto2.vb" id="Snippet1":::
387+
388388
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.
389389
390390
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.
@@ -404,9 +404,9 @@
404404
## Examples
405405
The following code example demonstrates generic and nongeneric versions of the <xref:System.Double.CompareTo%2A> method for several value and reference types.
406406
407-
[!code-cpp[T.CompareTo#1](~/samples/snippets/cpp/VS_Snippets_CLR/T.CompareTo/CPP/cat.cpp#1)]
408-
[!code-csharp[T.CompareTo#1](~/samples/snippets/csharp/VS_Snippets_CLR/T.CompareTo/CS/cat.cs#1)]
409-
[!code-vb[T.CompareTo#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/T.CompareTo/VB/cat.vb#1)]
407+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/T.CompareTo/CPP/cat.cpp" id="Snippet1":::
408+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/T.CompareTo/CS/cat.cs" interactive="try-dotnet" id="Snippet1":::
409+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/T.CompareTo/VB/cat.vb" id="Snippet1":::
410410
411411
]]></format>
412412
</remarks>
@@ -475,9 +475,9 @@
475475
476476
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.
477477
478-
[!code-csharp[System.Double.CompareTo#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto3.cs#2)]
479-
[!code-vb[System.Double.CompareTo#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.double.compareto/vb/compareto3.vb#2)]
480-
478+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto3.cs" interactive="try-dotnet" id="Snippet2":::
479+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.double.compareto/vb/compareto3.vb" id="Snippet2":::
480+
481481
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.
482482
483483
## Precision in Comparisons

xml/System/TimeSpan.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,10 +1610,10 @@
16101610
## Examples
16111611
The following example creates several <xref:System.TimeSpan> objects using the <xref:System.TimeSpan.FromTicks%2A> method.
16121612
1613-
[!code-cpp[System.TimeSpan.From#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.From/CPP/fromticks.cpp#1)]
1614-
[!code-csharp[System.TimeSpan.From#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.From/CS/fromticks.cs#1)]
1615-
[!code-vb[System.TimeSpan.From#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.From/VB/fromticks.vb#1)]
1616-
1613+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.From/CPP/fromticks.cpp" id="Snippet1":::
1614+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.From/CS/fromticks.cs" interactive="try-dotnet" id="Snippet1":::
1615+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.From/VB/fromticks.vb" id="Snippet1":::
1616+
16171617
]]></format>
16181618
</remarks>
16191619
<altmember cref="T:System.Int64" />

xml/System/Uri.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3179,10 +3179,10 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
31793179
31803180
## Examples
31813181
The following example creates a <xref:System.Uri> instance and determines whether it is a UNC path.
3182-
3183-
[!code-cpp[NCLUriExamples#6](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp#6)]
3184-
[!code-csharp[NCLUriExamples#6](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs#6)]
3185-
[!code-vb[NCLUriExamples#6](~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb#6)]
3182+
3183+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp" id="Snippet6":::
3184+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs" interactive="try-dotnet-method" id="Snippet6":::
3185+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb" id="Snippet6":::
31863186
31873187
]]></format>
31883188
</remarks>

0 commit comments

Comments
 (0)