Skip to content

Commit f70c939

Browse files
authored
.NET Interactive: Add_try_dotnet_batch_32c (#5489)
* add_try_dotnet * add_missing_sample
1 parent 36ead10 commit f70c939

File tree

8 files changed

+51
-51
lines changed

8 files changed

+51
-51
lines changed

xml/System.Globalization/RegionInfo.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,10 +1456,10 @@
14561456
## Examples
14571457
The following code example displays the properties of the <xref:System.Globalization.RegionInfo> class.
14581458
1459-
[!code-cpp[System.Globalization.RegionInfo_Properties#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.RegionInfo_Properties/CPP/regioninfo_properties.cpp#1)]
1460-
[!code-csharp[System.Globalization.RegionInfo_Properties#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.RegionInfo_Properties/CS/regioninfo_properties.cs#1)]
1461-
[!code-vb[System.Globalization.RegionInfo_Properties#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.RegionInfo_Properties/VB/regioninfo_properties.vb#1)]
1462-
1459+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.RegionInfo_Properties/CPP/regioninfo_properties.cpp" id="Snippet1":::
1460+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.RegionInfo_Properties/CS/regioninfo_properties.cs" interactive="try-dotnet" id="Snippet1":::
1461+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.RegionInfo_Properties/VB/regioninfo_properties.vb" id="Snippet1":::
1462+
14631463
]]></format>
14641464
</remarks>
14651465
<altmember cref="P:System.Globalization.RegionInfo.Name" />

xml/System.Numerics/BigInteger.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6756,9 +6756,9 @@ value Mod 2 = 0
67566756

67576757
If `value` is a hexadecimal string, the <xref:System.Numerics.BigInteger.Parse%28System.String%2CSystem.Globalization.NumberStyles%29> method interprets `value` as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to `0x80`. In other words, the method interprets the highest-order bit of the first byte in `value` as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in `value` must have a value of zero. For example, the method interprets `0x80` as a negative value, but it interprets either `0x080` or `0x0080` as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values.
67586758

6759-
[!code-csharp[System.Numerics.BigInteger.Parse#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Numerics.BigInteger.Parse/cs/ParseHex1.cs#3)]
6760-
[!code-vb[System.Numerics.BigInteger.Parse#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Numerics.BigInteger.Parse/vb/ParseHex1.vb#3)]
6761-
6759+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Numerics.BigInteger.Parse/cs/ParseHex1.cs" interactive="try-dotnet" id="Snippet3":::
6760+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Numerics.BigInteger.Parse/vb/ParseHex1.vb" id="Snippet3":::
6761+
67626762
The `value` parameter is parsed by using the formatting information in a <xref:System.Globalization.NumberFormatInfo> object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the <xref:System.Numerics.BigInteger.Parse%28System.String%2CSystem.Globalization.NumberStyles%2CSystem.IFormatProvider%29> overload.
67636763

67646764

@@ -7097,9 +7097,9 @@ If `provider` is `null`, the <xref:System.Globalization.NumberFormatInfo> object
70977097

70987098
If `value` is a hexadecimal string, the <xref:System.Numerics.BigInteger.Parse%28System.String%2CSystem.Globalization.NumberStyles%29> method interprets `value` as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to `0x80`. In other words, the method interprets the highest-order bit of the first byte in `value` as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in `value` must have a value of zero. For example, the method interprets `0x80` as a negative value, but it interprets either `0x080` or `0x0080` as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values.
70997099

7100-
[!code-csharp[System.Numerics.BigInteger.Parse#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Numerics.BigInteger.Parse/cs/ParseHex1.cs#3)]
7101-
[!code-vb[System.Numerics.BigInteger.Parse#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Numerics.BigInteger.Parse/vb/ParseHex1.vb#3)]
7102-
7100+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Numerics.BigInteger.Parse/cs/ParseHex1.cs" interactive="try-dotnet" id="Snippet3":::
7101+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Numerics.BigInteger.Parse/vb/ParseHex1.vb" id="Snippet3":::
7102+
71037103
The `provider` parameter is an <xref:System.IFormatProvider> implementation. Its <xref:System.IFormatProvider.GetFormat%2A> method returns a <xref:System.Globalization.NumberFormatInfo> object that provides culture-specific information about the format of `value`. Typically, `provider` can be any one of the following:
71047104

71057105
- A <xref:System.Globalization.CultureInfo> object that represents the culture that provides numeric formatting information. Its <xref:System.Globalization.CultureInfo.GetFormat%2A> method returns the <xref:System.Globalization.NumberFormatInfo> object that provides numeric formatting information.

xml/System/Array.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4122,9 +4122,9 @@
41224122
## Examples
41234123
The following example uses the <xref:System.Array.GetLowerBound%2A> and <xref:System.Array.GetUpperBound%2A> methods to display the bounds of a one-dimensional and two-dimensional array and to display the values of their array elements.
41244124

4125-
[!code-cpp[System.Array.GetUpperBound#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.array.getupperbound/cpp/source.cpp#1)]
4126-
[!code-csharp[System.Array.GetUpperBound#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.getupperbound/cs/source.cs#1)]
4127-
[!code-vb[System.Array.GetUpperBound#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.array.getupperbound/vb/source.vb#1)]
4125+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.array.getupperbound/cpp/source.cpp" id="Snippet1":::
4126+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.getupperbound/cs/source.cs" interactive="try-dotnet" id="Snippet1":::
4127+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.array.getupperbound/vb/source.vb" id="Snippet1":::
41284128

41294129
]]></format>
41304130
</remarks>

xml/System/Decimal.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,10 +1975,10 @@
19751975
## Examples
19761976
The following code example creates several pairs of `Decimal` values and calculates their products with the `Multiply` method.
19771977

1978-
[!code-cpp[System.Decimal.Mul_Div_Rem#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CPP/mul_div_rem.cpp#1)]
1979-
[!code-csharp[System.Decimal.Mul_Div_Rem#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem.cs#1)]
1980-
[!code-vb[System.Decimal.Mul_Div_Rem#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/VB/mul_div_rem.vb#1)]
1981-
1978+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CPP/mul_div_rem.cpp" id="Snippet1":::
1979+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem.cs" interactive="try-dotnet" id="Snippet1":::
1980+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/VB/mul_div_rem.vb" id="Snippet1":::
1981+
19821982
]]></format>
19831983
</remarks>
19841984
<exception cref="T:System.OverflowException">The return value is less than <see cref="F:System.Decimal.MinValue" /> or greater than <see cref="F:System.Decimal.MaxValue" />.</exception>

xml/System/Guid.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,9 @@
574574
## Examples
575575
The following example calls the <xref:System.Guid.CompareTo%28System.Guid%29> method to compare a GUID value with two similar GUID values.
576576
577-
[!code-csharp[System.Guid.CompareTo#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.compareto/cs/compareto2.cs#1)]
578-
[!code-vb[System.Guid.CompareTo#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.compareto/vb/compareto2.vb#1)]
579-
577+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.compareto/cs/compareto2.cs" interactive="try-dotnet" id="Snippet1":::
578+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.compareto/vb/compareto2.vb" id="Snippet1":::
579+
580580
]]></format>
581581
</remarks>
582582
</Docs>
@@ -665,9 +665,9 @@
665665
## Examples
666666
The following example uses the <xref:System.Runtime.InteropServices.GuidAttribute> attribute to assign a GUID to a class. It retrieves the value of this GUID by calling the <xref:System.Attribute.GetCustomAttribute%2A?displayProperty=nameWithType> method and passing the <xref:System.Runtime.InteropServices.GuidAttribute.Value%2A> property of the returned <xref:System.Runtime.InteropServices.GuidAttribute> object to the <xref:System.Guid.Parse%2A> method. Then it compares that GUID with an array of values.
667667
668-
[!code-csharp[System.Guid.CompareTo#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.compareto/cs/compareto1.cs#2)]
669-
[!code-vb[System.Guid.CompareTo#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.compareto/vb/compareto1.vb#2)]
670-
668+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.compareto/cs/compareto1.cs" interactive="try-dotnet" id="Snippet2":::
669+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.compareto/vb/compareto1.vb" id="Snippet2":::
670+
671671
]]></format>
672672
</remarks>
673673
<exception cref="T:System.ArgumentException">

xml/System/Int16.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,10 @@
692692
## Examples
693693
The following example demonstrates how to convert a string value into a 16-bit signed integer value using the <xref:System.Int16.Parse%28System.String%29?displayProperty=nameWithType> method. The resulting integer value is then displayed to the console.
694694
695-
[!code-cpp[System.Int16.Parse#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse1.cpp#1)]
696-
[!code-csharp[System.Int16.Parse#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs#1)]
697-
[!code-vb[System.Int16.Parse#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb#1)]
698-
695+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse1.cpp" id="Snippet1":::
696+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs" interactive="try-dotnet-method" id="Snippet1":::
697+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb" id="Snippet1":::
698+
699699
]]></format>
700700
</remarks>
701701
<exception cref="T:System.ArgumentNullException">
@@ -804,10 +804,10 @@
804804
## Examples
805805
The following example uses the <xref:System.Int16.Parse%28System.String%2CSystem.Globalization.NumberStyles%29?displayProperty=nameWithType> method to parse the string representations of <xref:System.Int16> values using the en-US culture.
806806
807-
[!code-cpp[System.Int16.Parse#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse2.cpp#2)]
808-
[!code-csharp[System.Int16.Parse#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse2.cs#2)]
809-
[!code-vb[System.Int16.Parse#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse2.vb#2)]
810-
807+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse2.cpp" id="Snippet2":::
808+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse2.cs" interactive="try-dotnet" id="Snippet2":::
809+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse2.vb" id="Snippet2":::
810+
811811
]]></format>
812812
</remarks>
813813
<exception cref="T:System.ArgumentNullException">
@@ -901,10 +901,10 @@
901901
## Examples
902902
The following example parses string representations of <xref:System.Int16> values with the <xref:System.Int16.Parse%28System.String%2CSystem.IFormatProvider%29?displayProperty=nameWithType> method.
903903
904-
[!code-cpp[System.Int16.Parse#4](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse4.cpp#4)]
905-
[!code-csharp[System.Int16.Parse#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs#4)]
906-
[!code-vb[System.Int16.Parse#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb#4)]
907-
904+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse4.cpp" id="Snippet4":::
905+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs" interactive="try-dotnet-method" id="Snippet4":::
906+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb" id="Snippet4":::
907+
908908
]]></format>
909909
</remarks>
910910
<exception cref="T:System.ArgumentNullException">
@@ -1055,10 +1055,10 @@
10551055
## Examples
10561056
The following example uses a variety of `style` and `provider` parameters to parse the string representations of <xref:System.Int16> values.
10571057
1058-
[!code-cpp[System.Int16.Parse#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse3.cpp#3)]
1059-
[!code-csharp[System.Int16.Parse#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs#3)]
1060-
[!code-vb[System.Int16.Parse#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb#3)]
1061-
1058+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse3.cpp" id="Snippet3":::
1059+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs" interactive="try-dotnet-method" id="Snippet3":::
1060+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb" id="Snippet3":::
1061+
10621062
]]></format>
10631063
</remarks>
10641064
<exception cref="T:System.ArgumentNullException">

xml/System/Type.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11966,10 +11966,10 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance
1196611966
## Examples
1196711967
The following example demonstrates how to use the `IsEnum` property.
1196811968

11969-
[!code-cpp[TestIsEnum#1](~/samples/snippets/cpp/VS_Snippets_CLR/TestIsEnum/CPP/TestIsEnum.cpp#1)]
11970-
[!code-csharp[TestIsEnum#1](~/samples/snippets/csharp/VS_Snippets_CLR/TestIsEnum/CS/testisenum.cs#1)]
11971-
[!code-vb[TestIsEnum#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/TestIsEnum/VB/testisenum.vb#1)]
11972-
11969+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/TestIsEnum/CPP/TestIsEnum.cpp" id="Snippet1":::
11970+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/TestIsEnum/CS/testisenum.cs" interactive="try-dotnet" id="Snippet1":::
11971+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/TestIsEnum/VB/testisenum.vb" id="Snippet1":::
11972+
1197311973
]]></format>
1197411974
</remarks>
1197511975
<altmember cref="T:System.Reflection.TypeAttributes" />
@@ -14260,10 +14260,10 @@ A signature type is a restricted type that can be passed to the <xref:System.Typ
1426014260
## Examples
1426114261
The following example creates a variable of type `MyEnum`, checks for the `IsValueType` property, and displays the result.
1426214262

14263-
[!code-cpp[Type_IsValueType#1](~/samples/snippets/cpp/VS_Snippets_CLR/Type_IsValueType/CPP/type_isvaluetype.cpp#1)]
14264-
[!code-csharp[Type_IsValueType#1](~/samples/snippets/csharp/VS_Snippets_CLR/Type_IsValueType/CS/type_isvaluetype.cs#1)]
14265-
[!code-vb[Type_IsValueType#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Type_IsValueType/VB/type_isvaluetype.vb#1)]
14266-
14263+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Type_IsValueType/CPP/type_isvaluetype.cpp" id="Snippet1":::
14264+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Type_IsValueType/CS/type_isvaluetype.cs" interactive="try-dotnet" id="Snippet1":::
14265+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/Type_IsValueType/VB/type_isvaluetype.vb" id="Snippet1":::
14266+
1426714267
]]></format>
1426814268
</remarks>
1426914269
<altmember cref="T:System.Reflection.TypeAttributes" />

xml/System/Version.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,10 @@
455455
## Examples
456456
The following code example demonstrates the <xref:System.Version.%23ctor%2A> constructor, and <xref:System.Version.Major%2A>, <xref:System.Version.Minor%2A>, <xref:System.Version.Build%2A>, <xref:System.Version.Revision%2A>, <xref:System.Version.MajorRevision%2A>, and <xref:System.Version.MinorRevision%2A> properties.
457457
458-
[!code-cpp[system.version.revision#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.version.revision/cpp/rev.cpp#1)]
459-
[!code-csharp[system.version.revision#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.version.revision/cs/rev.cs#1)]
460-
[!code-vb[system.version.revision#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.version.revision/vb/rev.vb#1)]
461-
458+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.version.revision/cpp/rev.cpp" id="Snippet1":::
459+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.version.revision/cs/rev.cs" interactive="try-dotnet" id="Snippet1":::
460+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.version.revision/vb/rev.vb" id="Snippet1":::
461+
462462
]]></format>
463463
</remarks>
464464
<exception cref="T:System.ArgumentOutOfRangeException">

0 commit comments

Comments
 (0)