Skip to content

Commit 4afaf9c

Browse files
authored
.NET Interactive: Add_try_dotnet_batch_31d (dotnet#5451)
* add_try_dotnet * add_row
1 parent c733321 commit 4afaf9c

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

xml/System/BitConverter.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,10 +1727,10 @@
17271727
## Examples
17281728
The following code example converts elements of <xref:System.Byte> arrays to <xref:System.Int64> values with the `ToInt64` method.
17291729
1730-
[!code-cpp[System.BitConverter.ToXXX.SInts#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CPP/batoint64.cpp#3)]
1731-
[!code-csharp[System.BitConverter.ToXXX.SInts#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint64.cs#3)]
1732-
[!code-vb[System.BitConverter.ToXXX.SInts#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/VB/batoint64.vb#3)]
1733-
1730+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CPP/batoint64.cpp" id="Snippet3":::
1731+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint64.cs" interactive="try-dotnet" id="Snippet3":::
1732+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/VB/batoint64.vb" id="Snippet3":::
1733+
17341734
]]></format>
17351735
</remarks>
17361736
<exception cref="T:System.ArgumentException">

xml/System/DateTime.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,9 +1731,9 @@ The behavior of the .NET Framework and COM means that if your application round-
17311731
## Examples
17321732
The following example uses the <xref:System.DateTime.AddMilliseconds%2A> method to add one millisecond and 1.5 milliseconds to a <xref:System.DateTime> value. It then displays each new value and displays the difference between it and the original value. The difference is displayed both as a time span and as a number of ticks. The example makes it clear that one millisecond equals 10,000 ticks. It also shows that fractional milliseconds are rounded before performing the addition; the <xref:System.DateTime> value that results from adding 1.5 milliseconds to the original date is 2 milliseconds greater than the original date.
17331733

1734-
[!code-csharp[System.DateTime.AddMilliseconds#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addmilliseconds/cs/addmilliseconds2.cs#1)]
1735-
[!code-vb[System.DateTime.AddMilliseconds#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.datetime.addmilliseconds/vb/addmilliseconds2.vb#1)]
1736-
1734+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addmilliseconds/cs/addmilliseconds2.cs" interactive="try-dotnet-method" id="Snippet1":::
1735+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.datetime.addmilliseconds/vb/addmilliseconds2.vb" id="Snippet1":::
1736+
17371737
]]></format>
17381738
</remarks>
17391739
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />.</exception>

xml/System/DateTimeOffset.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3863,8 +3863,8 @@
38633863
38643864
The following example parses an array of strings that are expected to conform to [ISO 8601](/dotnet/standard/base-types/standard-date-and-time-format-strings#the-round-trip-o-o-format-specifier). As the output from the example shows, strings with leading or trailing spaces fail to parse successfully, as do strings with date and time elements that are out of range.
38653865
3866-
[!code-csharp[Parsing an ISO 8601 string](~/samples/snippets/csharp/api/system/datetimeoffset/parseexact/parseexact-iso8601.cs)]
3867-
[!code-vb[Parsing an ISO 8601 string](~/samples/snippets/visualbasic/api/system/datetimeoffset/parseexact/parseexact-iso8601.vb)]
3866+
:::code language="csharp" source="~/samples/snippets/csharp/api/system/datetimeoffset/parseexact/parseexact-iso8601.cs" interactive="try-dotnet":::
3867+
:::code language="vb" source="~/samples/snippets/visualbasic/api/system/datetimeoffset/parseexact/parseexact-iso8601.vb":::
38683868
38693869
38703870
]]></format>
@@ -4156,8 +4156,8 @@ The following example uses a variety of <xref:System.Globalization.DateTimeStyle
41564156
41574157
Strings that do not specify a UTC offset are assumed to have the offset of the local time zone (in this case, -07:00) unless the <xref:System.Globalization.DateTimeStyles.AssumeUniversal?displayProperty=nameWithType> flag is supplied in the method call. In that case, they are assumed to be Universal Coordinated Time.
41584158
4159-
[!code-csharp[Parsing ISO 8601 strings](~/samples/snippets/csharp/api/system/datetimeoffset/parseexact/parseexact-iso8601-2.cs)]
4160-
[!code-vb[Parsing ISO 8601 strings](~/samples/snippets/visualbasic/api/system/datetimeoffset/parseexact/parseexact-iso8601-2.vb)]
4159+
:::code language="csharp" source="~/samples/snippets/csharp/api/system/datetimeoffset/parseexact/parseexact-iso8601-2.cs" interactive="try-dotnet":::
4160+
:::code language="vb" source="~/samples/snippets/visualbasic/api/system/datetimeoffset/parseexact/parseexact-iso8601-2.vb":::
41614161
41624162
41634163
]]></format>

xml/System/Decimal.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,15 +1601,15 @@
16011601
## Examples
16021602
The following example uses the `GetBits` method to convert several `Decimal` values to their equivalent binary representations. It then displays the decimal values and the hexadecimal value of the elements in the array returned by the <xref:System.Decimal.GetBits%2A> method.
16031603

1604-
[!code-cpp[System.Decimal.Get_Bits_Hash_Type#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CPP/getbits.cpp#2)]
1605-
[!code-csharp[System.Decimal.Get_Bits_Hash_Type#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/getbits.cs#2)]
1606-
[!code-vb[System.Decimal.Get_Bits_Hash_Type#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/VB/getbits.vb#2)]
1607-
1604+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CPP/getbits.cpp" id="Snippet2":::
1605+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/getbits.cs" interactive="try-dotnet" id="Snippet2":::
1606+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/VB/getbits.vb" id="Snippet2":::
1607+
16081608
The following example uses the <xref:System.Decimal.GetBits%2A> method to retrieve the component parts of an array. It then uses this array in the call to the <xref:System.Decimal.%23ctor%28System.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Boolean%2CSystem.Byte%29> constructor to instantiate a new <xref:System.Decimal> value.
16091609

1610-
[!code-csharp[System.Decimal.Ctor#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.ctor/cs/ctor2a.cs#1)]
1611-
[!code-vb[System.Decimal.Ctor#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.decimal.ctor/vb/ctor2a.vb#1)]
1612-
1610+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.ctor/cs/ctor2a.cs" interactive="try-dotnet" id="Snippet1":::
1611+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.decimal.ctor/vb/ctor2a.vb" id="Snippet1":::
1612+
16131613
]]></format>
16141614
</remarks>
16151615
<altmember cref="Overload:System.Decimal.#ctor" />

xml/System/TimeSpan.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,10 +1794,10 @@
17941794
## Examples
17951795
The following example references and displays the value of the <xref:System.TimeSpan.MaxValue> field.
17961796
1797-
[!code-cpp[System.TimeSpan.Fields#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.Fields/CPP/fields.cpp#1)]
1798-
[!code-csharp[System.TimeSpan.Fields#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.Fields/CS/fields.cs#1)]
1799-
[!code-vb[System.TimeSpan.Fields#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.Fields/VB/fields.vb#1)]
1800-
1797+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.Fields/CPP/fields.cpp" id="Snippet1":::
1798+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.Fields/CS/fields.cs" interactive="try-dotnet" id="Snippet1":::
1799+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.Fields/VB/fields.vb" id="Snippet1":::
1800+
18011801
]]></format>
18021802
</remarks>
18031803
<altmember cref="T:System.Int64" />

0 commit comments

Comments
 (0)