Skip to content

Commit c9ae790

Browse files
authored
enable_try_dotnet_to_batch_14c (#4501)
1 parent 4158396 commit c9ae790

File tree

6 files changed

+53
-83
lines changed

6 files changed

+53
-83
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,8 @@
735735
736736
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.
737737
738-
[!code-csharp[Generic.Stack#1](~/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs#1)]
739-
[!code-vb[Generic.Stack#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb#1)]
738+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs" interactive="try-dotnet" id="Snippet1":::
739+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
740740
741741
]]></format>
742742
</remarks>

xml/System.Security.Cryptography/HashAlgorithm.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,8 +1308,8 @@ For more information about Dispose and Finalize, see [Cleaning Up Unmanaged Reso
13081308
## Examples
13091309
The following code examples use the <xref:System.Security.Cryptography.HashAlgorithm.TransformFinalBlock%2A> method with the <xref:System.Security.Cryptography.HashAlgorithm.TransformBlock%2A> method to hash a string.
13101310
1311-
[!code-csharp[Cryptography.HashAlgorithm.TransformFinalBlock#1](~/samples/snippets/csharp/VS_Snippets_CLR/Cryptography.HashAlgorithm.TransformFinalBlock/CS/sample.cs#1)]
1312-
[!code-vb[Cryptography.HashAlgorithm.TransformFinalBlock#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Cryptography.HashAlgorithm.TransformFinalBlock/vb/sample.vb#1)]
1311+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Cryptography.HashAlgorithm.TransformFinalBlock/CS/sample.cs" interactive="try-dotnet" id="Snippet1":::
1312+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/Cryptography.HashAlgorithm.TransformFinalBlock/vb/sample.vb" id="Snippet1":::
13131313
13141314
]]></format>
13151315
</remarks>

xml/System.Text/StringBuilder.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3596,9 +3596,9 @@
35963596
## Examples
35973597
The following example demonstrates the <xref:System.Text.StringBuilder.Capacity%2A> property.
35983598
3599-
[!code-cpp[stringbuilder.ensurecapacity#1](~/samples/snippets/cpp/VS_Snippets_CLR/stringbuilder.ensurecapacity/CPP/cap.cpp#1)]
3600-
[!code-csharp[stringbuilder.ensurecapacity#1](~/samples/snippets/csharp/VS_Snippets_CLR/stringbuilder.ensurecapacity/CS/cap.cs#1)]
3601-
[!code-vb[stringbuilder.ensurecapacity#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/stringbuilder.ensurecapacity/VB/cap.vb#1)]
3599+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/stringbuilder.ensurecapacity/CPP/cap.cpp" id="Snippet1":::
3600+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/stringbuilder.ensurecapacity/CS/cap.cs" interactive="try-dotnet" id="Snippet1":::
3601+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/stringbuilder.ensurecapacity/VB/cap.vb" id="Snippet1":::
36023602
36033603
]]></format>
36043604
</remarks>

xml/System/BitConverter.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,9 +1150,9 @@
11501150
## Examples
11511151
The following code example converts elements of <xref:System.Byte> arrays to <xref:System.Boolean> values with the `ToBoolean` method.
11521152
1153-
[!code-cpp[System.BitConverter.ToXXX.Others#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CPP/batobool.cpp#1)]
1154-
[!code-csharp[System.BitConverter.ToXXX.Others#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batobool.cs#1)]
1155-
[!code-vb[System.BitConverter.ToXXX.Others#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/VB/batobool.vb#1)]
1153+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CPP/batobool.cpp" id="Snippet1":::
1154+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batobool.cs" interactive="try-dotnet" id="Snippet1":::
1155+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/VB/batobool.vb" id="Snippet1":::
11561156
11571157
]]></format>
11581158
</remarks>

xml/System/Decimal.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6452,9 +6452,9 @@ This member is an explicit interface member implementation. It can be used only
64526452
## Examples
64536453
The following code example converts `Decimal` numbers to <xref:System.Double> values using `ToDouble` method.
64546454

6455-
[!code-cpp[System.Decimal.ToXXX#5](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CPP/tosgl_dbl.cpp#5)]
6456-
[!code-csharp[System.Decimal.ToXXX#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tosgl_dbl.cs#5)]
6457-
[!code-vb[System.Decimal.ToXXX#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.ToXXX/VB/tosgl_dbl.vb#5)]
6455+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CPP/tosgl_dbl.cpp" id="Snippet5":::
6456+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tosgl_dbl.cs" interactive="try-dotnet" id="Snippet5":::
6457+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Decimal.ToXXX/VB/tosgl_dbl.vb" id="Snippet5":::
64586458

64596459
]]></format>
64606460
</remarks>

xml/System/Type.xml

Lines changed: 40 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,6 +2381,45 @@ The `filter` argument can be a custom delegate of type <xref:System.Reflection.M
23812381
</AssemblyInfo>
23822382
<Docs>
23832383
<summary>Gets the constructors of the current <see cref="T:System.Type" />.</summary>
2384+
<remarks>
2385+
<format type="text/markdown"><![CDATA[
2386+
2387+
## Examples
2388+
2389+
This example shows the output of the <xref:System.Type.GetConstructors> overload from a class that has two instance constructors and one static constructor.
2390+
2391+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CPP/source1.cpp" id="Snippet1":::
2392+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source1.cs" interactive="try-dotnet" id="Snippet1":::
2393+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/VB/source1.vb" id="Snippet1":::
2394+
2395+
The output of this code is:
2396+
2397+
2
2398+
2399+
False
2400+
2401+
False
2402+
2403+
Because the <xref:System.Type.GetConstructors%2A> overload uses only <xref:System.Reflection.BindingFlags.Public> and <xref:System.Reflection.BindingFlags.Instance>, the static constructor is neither counted by the `for` expression nor evaluated by `IsStatic`.
2404+
2405+
To find static constructors, use the <xref:System.Type.GetConstructors%2A> overload, and pass it the combination (logical OR) of <xref:System.Reflection.BindingFlags.Public?displayProperty=nameWithType>, <xref:System.Reflection.BindingFlags.Static?displayProperty=nameWithType>, <xref:System.Reflection.BindingFlags.NonPublic?displayProperty=nameWithType>, <xref:System.Reflection.BindingFlags.Instance?displayProperty=nameWithType>, as shown in the following code example:
2406+
2407+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CPP/source2.cpp" id="Snippet2":::
2408+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source2.cs" interactive="try-dotnet" id="Snippet2":::
2409+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/VB/source2.vb" id="Snippet2":::
2410+
2411+
Now the output is:
2412+
2413+
3
2414+
2415+
False
2416+
2417+
True
2418+
2419+
False
2420+
2421+
]]></format>
2422+
</remarks>
23842423
</Docs>
23852424
</MemberGroup>
23862425
<Member MemberName="GetConstructors">
@@ -2456,43 +2495,8 @@ The `filter` argument can be a custom delegate of type <xref:System.Reflection.M
24562495
If the current <xref:System.Type> represents a constructed generic type, this method returns the <xref:System.Reflection.ConstructorInfo> objects with the type parameters replaced by the appropriate type arguments. For example, if class `C<T>` has a constructor `C(T t1)` (`Sub New(ByVal t1 As T)` in Visual Basic), calling <xref:System.Type.GetConstructors%2A> on `C<int>` returns a <xref:System.Reflection.ConstructorInfo> that represents `C(int t1)` in C# (`Sub New(ByVal t1 As Integer)` in Visual Basic).
24572496

24582497
If the current <xref:System.Type> represents a generic type parameter, the <xref:System.Type.GetConstructors%2A> method returns an empty array.
2459-
24602498

2461-
2462-
## Examples
2463-
This example shows the output of the <xref:System.Type.GetConstructors%2A> overload from a class that has two instance constructors and one static constructor.
2464-
2465-
[!code-cpp[Classic Type.GetConstructors Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CPP/source1.cpp#1)]
2466-
[!code-csharp[Classic Type.GetConstructors Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source1.cs#1)]
2467-
[!code-vb[Classic Type.GetConstructors Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/VB/source1.vb#1)]
2468-
2469-
The output of this code is:
2470-
2471-
2
2472-
2473-
False
2474-
2475-
False
2476-
2477-
Because the <xref:System.Type.GetConstructors> overload uses only <xref:System.Reflection.BindingFlags.Public?displayProperty=nameWithType> and <xref:System.Reflection.BindingFlags.Instance?displayProperty=nameWithType>, the static constructor is neither counted by the `for` expression nor evaluated by `IsStatic`.
2478-
2479-
To find static constructors, use the <xref:System.Type.GetConstructors%28System.Reflection.BindingFlags%29> overload, and pass the combination (logical `OR`) of <xref:System.Reflection.BindingFlags.Public?displayProperty=nameWithType>, <xref:System.Reflection.BindingFlags.Static?displayProperty=nameWithType>, <xref:System.Reflection.BindingFlags.NonPublic?displayProperty=nameWithType>, <xref:System.Reflection.BindingFlags.Instance?displayProperty=nameWithType>, as shown in the following code example:
2480-
2481-
[!code-cpp[Classic Type.GetConstructors Example#2](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CPP/source2.cpp#2)]
2482-
[!code-csharp[Classic Type.GetConstructors Example#2](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source2.cs#2)]
2483-
[!code-vb[Classic Type.GetConstructors Example#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/VB/source2.vb#2)]
2484-
2485-
Now the output is:
2486-
2487-
3
2488-
2489-
False
2490-
2491-
True
2492-
2493-
False
2494-
2495-
]]></format>
2499+
]]></format>
24962500
</remarks>
24972501
<altmember cref="T:System.Reflection.ConstructorInfo" />
24982502
<altmember cref="M:System.Type.GetConstructor(System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" />
@@ -2568,40 +2572,6 @@ If the current <xref:System.Type> represents a constructed generic type, this me
25682572

25692573
If the current <xref:System.Type> represents a generic type parameter, the <xref:System.Type.GetConstructors%2A> method returns an empty array.
25702574

2571-
## Examples
2572-
2573-
This example shows the output of the <xref:System.Type.GetConstructors> overload from a class that has two instance constructors and one static constructor.
2574-
2575-
[!code-cpp[Classic Type.GetConstructors Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CPP/source1.cpp#1)]
2576-
[!code-csharp[Classic Type.GetConstructors Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source1.cs#1)]
2577-
[!code-vb[Classic Type.GetConstructors Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/VB/source1.vb#1)]
2578-
2579-
The output of this code is:
2580-
2581-
2
2582-
2583-
False
2584-
2585-
False
2586-
2587-
Because the <xref:System.Type.GetConstructors%2A> overload uses only <xref:System.Reflection.BindingFlags.Public> and <xref:System.Reflection.BindingFlags.Instance>, the static constructor is neither counted by the `for` expression nor evaluated by `IsStatic`.
2588-
2589-
To find static constructors, use the <xref:System.Type.GetConstructors%2A> overload, and pass it the combination (logical OR) of <xref:System.Reflection.BindingFlags.Public?displayProperty=nameWithType>, <xref:System.Reflection.BindingFlags.Static?displayProperty=nameWithType>, <xref:System.Reflection.BindingFlags.NonPublic?displayProperty=nameWithType>, <xref:System.Reflection.BindingFlags.Instance?displayProperty=nameWithType>, as shown in the following code example:
2590-
2591-
[!code-cpp[Classic Type.GetConstructors Example#2](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CPP/source2.cpp#2)]
2592-
[!code-csharp[Classic Type.GetConstructors Example#2](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source2.cs#2)]
2593-
[!code-vb[Classic Type.GetConstructors Example#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/VB/source2.vb#2)]
2594-
2595-
Now the output is:
2596-
2597-
3
2598-
2599-
False
2600-
2601-
True
2602-
2603-
False
2604-
26052575
]]></format>
26062576
</remarks>
26072577
<altmember cref="T:System.Reflection.ConstructorInfo" />

0 commit comments

Comments
 (0)