Skip to content

Commit 62152ca

Browse files
authored
.NET Interactive: Add_try_dotnet_To_batch_32a (dotnet#5461)
* add_try_dotnet * update_sample_from_batch_31
1 parent 4afaf9c commit 62152ca

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,9 @@
809809
810810
The <xref:System.Collections.Generic.Stack%601.Contains%2A> method is used to show that the string "four" is in the first copy of the stack, after which the <xref:System.Collections.Generic.Stack%601.Clear%2A> method clears the copy and the <xref:System.Collections.Generic.Stack%601.Count%2A> property shows that the stack is empty.
811811
812-
[!code-csharp[Generic.Stack#1](~/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs#1)]
813-
[!code-vb[Generic.Stack#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb#1)]
814-
812+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs" interactive="try-dotnet" id="Snippet1":::
813+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
814+
815815
]]></format>
816816
</remarks>
817817
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Collections.Generic.Stack`1" /> is empty.</exception>

xml/System.Text/StringBuilder.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5439,9 +5439,9 @@ The existing characters are shifted to make room for the character sequence in t
54395439
## Examples
54405440
The following example demonstrates the <xref:System.Text.StringBuilder.Length%2A> property.
54415441
5442-
[!code-cpp[stringbuilder.ensurecapacity#1](~/samples/snippets/cpp/VS_Snippets_CLR/stringbuilder.ensurecapacity/CPP/cap.cpp#1)]
5443-
[!code-csharp[stringbuilder.ensurecapacity#1](~/samples/snippets/csharp/VS_Snippets_CLR/stringbuilder.ensurecapacity/CS/cap.cs#1)]
5444-
[!code-vb[stringbuilder.ensurecapacity#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/stringbuilder.ensurecapacity/VB/cap.vb#1)]
5442+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/stringbuilder.ensurecapacity/CPP/cap.cpp" id="Snippet1":::
5443+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/stringbuilder.ensurecapacity/CS/cap.cs" interactive="try-dotnet" id="Snippet1":::
5444+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/stringbuilder.ensurecapacity/VB/cap.vb" id="Snippet1":::
54455445
54465446
]]></format>
54475447
</remarks>

xml/System/BitConverter.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,10 +2184,10 @@
21842184
## Examples
21852185
The following code example converts elements of <xref:System.Byte> arrays to <xref:System.UInt16> values with the `ToUInt16` method.
21862186
2187-
[!code-cpp[System.BitConverter.ToXXX.UInts#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CPP/batouint16.cpp#1)]
2188-
[!code-csharp[System.BitConverter.ToXXX.UInts#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint16.cs#1)]
2189-
[!code-vb[System.BitConverter.ToXXX.UInts#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/VB/batouint16.vb#1)]
2190-
2187+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CPP/batouint16.cpp" id="Snippet1":::
2188+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint16.cs" interactive="try-dotnet" id="Snippet1":::
2189+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/VB/batouint16.vb" id="Snippet1":::
2190+
21912191
]]></format>
21922192
</remarks>
21932193
<exception cref="T:System.ArgumentException">

xml/System/TimeSpan.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,10 +1733,10 @@
17331733
## Examples
17341734
The following example creates several <xref:System.TimeSpan> objects and displays the <xref:System.TimeSpan.Hours%2A> property of each.
17351735
1736-
[!code-cpp[System.TimeSpan.Properties#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.Properties/CPP/properties.cpp#1)]
1737-
[!code-csharp[System.TimeSpan.Properties#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.Properties/CS/properties.cs#1)]
1738-
[!code-vb[System.TimeSpan.Properties#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.Properties/VB/properties.vb#1)]
1739-
1736+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.Properties/CPP/properties.cpp" id="Snippet1":::
1737+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.Properties/CS/properties.cs" interactive="try-dotnet" id="Snippet1":::
1738+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.Properties/VB/properties.vb" id="Snippet1":::
1739+
17401740
]]></format>
17411741
</remarks>
17421742
<altmember cref="P:System.TimeSpan.TotalHours" />
@@ -3558,9 +3558,9 @@ When a time interval component in the string to be parsed contains more than sev
35583558
35593559
In addition, the example changes the way in which the time interval parsing methods interpret a single digit. Ordinarily, a single digit is interpreted as the number of days in a time interval. Instead, the `%h` custom format string is used to interpret a single digit as the number of hours. For this change to be effective, note that the `%h` custom format string must precede the other format strings in the `formats` array. Also note from the output that the <xref:System.Globalization.TimeSpanStyles.AssumeNegative?displayProperty=nameWithType> flag specified in the method call is used only when parsing a string with this format specifier.
35603560
3561-
[!code-csharp[System.TimeSpan.ParseExact#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.parseexact/cs/parseexactexample4.cs#4)]
3562-
[!code-vb[System.TimeSpan.ParseExact#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.parseexact/vb/parseexactexample4.vb#4)]
3563-
3561+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.parseexact/cs/parseexactexample4.cs" interactive="try-dotnet" id="Snippet4":::
3562+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.parseexact/vb/parseexactexample4.vb" id="Snippet4":::
3563+
35643564
]]></format>
35653565
</remarks>
35663566
<exception cref="T:System.ArgumentException">
@@ -3984,10 +3984,10 @@ This member is an explicit interface member implementation. It can be used only
39843984
## Examples
39853985
The following example references and displays the value of the <xref:System.TimeSpan.TicksPerMillisecond> field.
39863986
3987-
[!code-cpp[System.TimeSpan.Fields#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.Fields/CPP/fields.cpp#1)]
3988-
[!code-csharp[System.TimeSpan.Fields#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.Fields/CS/fields.cs#1)]
3989-
[!code-vb[System.TimeSpan.Fields#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.Fields/VB/fields.vb#1)]
3990-
3987+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.Fields/CPP/fields.cpp" id="Snippet1":::
3988+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.Fields/CS/fields.cs" interactive="try-dotnet" id="Snippet1":::
3989+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.Fields/VB/fields.vb" id="Snippet1":::
3990+
39913991
]]></format>
39923992
</remarks>
39933993
<altmember cref="T:System.Int64" />

0 commit comments

Comments
 (0)