Skip to content

Commit 07482dc

Browse files
v-mepamairaw
andauthored
NET Interactive: Enable_try_dotnet_to_batch_10a (#4306)
* enable_try_dotnet_to_batch_10a * remove_line_spacing * Update xml/System.Collections.Generic/SortedDictionary`2.xml Co-authored-by: Maira Wenzel <[email protected]> * Update xml/System.Collections.Generic/SortedList`2.xml Co-authored-by: Maira Wenzel <[email protected]> * Update xml/System.Collections.Generic/SortedList`2.xml Co-authored-by: Maira Wenzel <[email protected]> * Update xml/System.Collections.Generic/SortedList`2.xml Co-authored-by: Maira Wenzel <[email protected]> * Update xml/System.Collections.Generic/SortedList`2.xml Co-authored-by: Maira Wenzel <[email protected]> * Update xml/System.Collections.Generic/SortedList`2.xml Co-authored-by: Maira Wenzel <[email protected]> * Update xml/System.Collections.Generic/SortedList`2.xml Co-authored-by: Maira Wenzel <[email protected]> Co-authored-by: Maira Wenzel <[email protected]>
1 parent 146df60 commit 07482dc

File tree

8 files changed

+64
-99
lines changed

8 files changed

+64
-99
lines changed

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

Lines changed: 40 additions & 75 deletions
Large diffs are not rendered by default.

xml/System.Collections.Generic/SortedDictionary`2.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@
128128
129129
Finally, the example demonstrates the <xref:System.Collections.Generic.SortedDictionary%602.Remove%2A> method.
130130
131-
[!code-csharp[Generic.SortedDictionary#1](~/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary/CS/source.cs#1)]
132-
[!code-vb[Generic.SortedDictionary#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb#1)]
131+
[!code-csharp[Generic.SortedDictionary#1](~/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary/CS/source.cs#1)]
132+
[!code-vb[Generic.SortedDictionary#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb#1)]
133133
134134
]]></format>
135135
</remarks>

xml/System.Collections.Generic/SortedList`2.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@
103103
104104
Another difference between the <xref:System.Collections.Generic.SortedDictionary%602> and <xref:System.Collections.Generic.SortedList%602> classes is that <xref:System.Collections.Generic.SortedList%602> supports efficient indexed retrieval of keys and values through the collections returned by the <xref:System.Collections.Generic.SortedList%602.Keys%2A> and <xref:System.Collections.Generic.SortedList%602.Values%2A> properties. It is not necessary to regenerate the lists when the properties are accessed, because the lists are just wrappers for the internal arrays of keys and values. The following code shows the use of the <xref:System.Collections.Generic.SortedList%602.Values%2A> property for indexed retrieval of values from a sorted list of strings:
105105
106-
[!code-cpp[Generic.SortedList#11](~/samples/snippets/cpp/VS_Snippets_CLR/Generic.SortedList/cpp/remarks.cpp#11)]
107-
[!code-csharp[Generic.SortedList#11](~/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/remarks.cs#11)]
108-
[!code-vb[Generic.SortedList#11](~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb#11)]
106+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Generic.SortedList/cpp/remarks.cpp" id="Snippet11":::
107+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/remarks.cs" id="Snippet11":::
108+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb" id="Snippet11":::
109109
110110
<xref:System.Collections.Generic.SortedList%602> is implemented as an array of key/value pairs, sorted by the key. Each element can be retrieved as a <xref:System.Collections.Generic.KeyValuePair%602> object.
111111
@@ -119,9 +119,9 @@
119119
120120
The `foreach` statement of the C# language (`for each` in C++, `For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since the elements of the <xref:System.Collections.Generic.SortedList%602> are key/value pairs, the element type is not the type of the key or the type of the value. Instead, the element type is <xref:System.Collections.Generic.KeyValuePair%602>. For example:
121121
122-
[!code-cpp[Generic.SortedList#12](~/samples/snippets/cpp/VS_Snippets_CLR/Generic.SortedList/cpp/remarks.cpp#12)]
123-
[!code-csharp[Generic.SortedList#12](~/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/remarks.cs#12)]
124-
[!code-vb[Generic.SortedList#12](~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb#12)]
122+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Generic.SortedList/cpp/remarks.cpp" id="Snippet12":::
123+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/remarks.cs" id="Snippet12":::
124+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb" id="Snippet12":::
125125
126126
The `foreach` statement is a wrapper around the enumerator, which only allows reading from, not writing to, the collection.
127127

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@
112112
113113
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.
114114
115-
[!code-csharp[Generic.Stack#1](~/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs#1)]
116-
[!code-vb[Generic.Stack#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb#1)]
115+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs" interactive="try-dotnet" id="Snippet1":::
116+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
117117
118118
]]></format>
119119
</remarks>

xml/System/Activator.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,9 @@
391391
## Examples
392392
The following code example demonstrates how to call the <xref:System.Activator.CreateInstance%28System.Type%29> method. Instances of several different types are created and their default values are displayed.
393393
394-
[!code-cpp[ActivatorX#4](~/samples/snippets/cpp/VS_Snippets_CLR/ActivatorX/cpp/source2.cpp#4)]
395-
[!code-csharp[ActivatorX#4](~/samples/snippets/csharp/VS_Snippets_CLR/ActivatorX/cs/source2.cs#4)]
396-
[!code-vb[ActivatorX#4](~/samples/snippets/visualbasic/VS_Snippets_CLR/ActivatorX/VB/source2.vb#4)]
394+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/ActivatorX/cpp/source2.cpp" id="Snippet4":::
395+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/ActivatorX/cs/source2.cs" interactive="try-dotnet" id="Snippet4":::
396+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/ActivatorX/VB/source2.vb" id="Snippet4":::
397397
398398
]]></format>
399399
</remarks>
@@ -760,13 +760,13 @@
760760
## Examples
761761
The following example calls the <xref:System.Activator.CreateInstance%28System.Type%2CSystem.Object%5B%5D%29> method to create a <xref:System.String> object. It calls the <xref:System.String.%23ctor%28System.Char%5B%5D%2CSystem.Int32%2CSystem.Int32%29?displayProperty=nameWithType> constructor to instantiate a string that contains ten elements from a character array starting at the fourteenth position.
762762
763-
[!code-csharp[System.Activator.CreateInstance#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/CreateInstance5.cs#5)]
764-
[!code-vb[System.Activator.CreateInstance#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.activator.createinstance/vb/CreateInstance5.vb#5)]
763+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/CreateInstance5.cs" interactive="try-dotnet" id="Snippet5":::
764+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.activator.createinstance/vb/CreateInstance5.vb" id="Snippet5":::
765765
766766
The following example creates a jagged array whose elements are arguments to be passed to a <xref:System.String> constructor. The example then passes each array to the <xref:System.Activator.CreateInstance%28System.Type%2CSystem.Object%5B%5D%29> method to invoke the appropriate string constructor.
767767
768-
[!code-csharp[System.Activator.CreateInstance#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/createinstance2.cs#4)]
769-
[!code-vb[System.Activator.CreateInstance#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.activator.createinstance/vb/createinstance2.vb#4)]
768+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/createinstance2.cs" interactive="try-dotnet" id="Snippet4":::
769+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.activator.createinstance/vb/createinstance2.vb" id="Snippet4":::
770770
771771
]]></format>
772772
</remarks>

xml/System/Array.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6160,8 +6160,8 @@
61606160
## Examples
61616161
The following example uses the <xref:System.Array.Length%2A> property to get the total number of elements in an array. It also uses the <xref:System.Array.GetUpperBound%2A> method to determine the number of elements in each dimension of a multidimensional array.
61626162

6163-
[!code-csharp[System.Array.Length#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.length/cs/length1.cs#1)]
6164-
[!code-vb[System.Array.Length#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.array.length/vb/length1.vb#1)]
6163+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.length/cs/length1.cs" interactive="try-dotnet" id="Snippet1":::
6164+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.array.length/vb/length1.vb" id="Snippet1":::
61656165

61666166
]]></format>
61676167
</remarks>

xml/System/Guid.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575
## Examples
7676
The following example uses the <xref:System.Runtime.InteropServices.GuidAttribute?displayProperty=nameWithType> class to assign a GUID to an interface and to a user-defined class. It retrieves the value of the GUID by calling the <xref:System.Attribute.GetCustomAttribute%2A> method, and compares it with two other GUIDs to determine whether they are equal.
7777
78-
[!code-cpp[Guid#1](~/samples/snippets/cpp/VS_Snippets_CLR/Guid/CPP/Guids.cpp#1)]
79-
[!code-csharp[Guid#1](~/samples/snippets/csharp/VS_Snippets_CLR/Guid/CS/Guids.cs#1)]
80-
[!code-vb[Guid#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Guid/VB/Guids.vb#1)]
78+
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Guid/CPP/Guids.cpp" id="Snippet1":::
79+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Guid/CS/Guids.cs" interactive="try-dotnet" id="Snippet1":::
80+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/Guid/VB/Guids.vb" id="Snippet1":::
8181
8282
Note that the <xref:System.Runtime.InteropServices.GuidAttribute> attribute is typically used in an application to expose a type to COM. If you compile this example, you can run the [Assembly Registration tool (Regasm.exe)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool) on the generated assembly to create registry (.reg) and type library (.tlb) files. The .reg file can be used to register the coclass in the registry, and the .tlb file can provide metadata for COM interop.
8383

xml/System/IFormatProvider.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
## Examples
6666
The following example illustrates how an <xref:System.IFormatProvider> implementation can change the representation of a date and time value. In this case, a single date is displayed by using <xref:System.Globalization.CultureInfo> objects that represent four different cultures.
6767
68-
[!code-csharp[System.IFormatProvider.Class#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.IFormatProvider.Class/cs/provider2.cs#3)]
69-
[!code-vb[System.IFormatProvider.Class#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.IFormatProvider.Class/vb/provider2.vb#3)]
68+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.IFormatProvider.Class/cs/provider2.cs" interactive="try-dotnet" id="Snippet3":::
69+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.IFormatProvider.Class/vb/provider2.vb" id="Snippet3":::
7070
7171
The following example illustrates the use of a class that implements the <xref:System.IFormatProvider> interface and the <xref:System.IFormatProvider.GetFormat%2A> method. The `AcctNumberFormat` class converts an <xref:System.Int64> value that represents an account number to a formatted 12-digit account number. Its `GetFormat` method returns a reference to the current `AcctNumberFormat` instance if the `formatType` parameter refers to a class that implements <xref:System.ICustomFormatter>; otherwise, `GetFormat` returns `null`.
7272

0 commit comments

Comments
 (0)