Skip to content

Commit d478272

Browse files
Merge pull request #12124 from dotnet/main
Merge main into live
2 parents 3853cd0 + b437b35 commit d478272

File tree

162 files changed

+1634
-1641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+1634
-1641
lines changed

includes/csharp-interactive-with-utc-note.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
## Examples
9595
The following example derives a class, `BoxLengthFirst`, from the <xref:System.Collections.Generic.Comparer%601> class. This comparer compares two objects of type `Box`. It sorts them first by length, then by height, and then by width. The `Box` class implements the <xref:System.IComparable%601> interface to control the default comparison between two `Box` objects. This default implementation sorts first by height, then by length, and then by width. The example shows the differences between the two comparisons by sorting a list of `Box` objects first by using the `BoxLengthFirst` comparer and then by using the default comparer.
9696
97-
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ComparerT/Overview/program.cs" interactive="try-dotnet" id="Snippet1":::
97+
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ComparerT/Overview/program.cs" id="Snippet1":::
9898
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/ComparerT/Overview/program.fs" id="Snippet1":::
9999
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ComparerT/Overview/program.vb" id="Snippet1":::
100100

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
## Examples
327327
The following code example shows how to use the <xref:System.Collections.Generic.Dictionary%602.%23ctor%28System.Collections.Generic.IEqualityComparer%7B%600%7D%29> constructor to initialize a <xref:System.Collections.Generic.Dictionary%602> with sorted content from another dictionary. The code example creates a <xref:System.Collections.Generic.SortedDictionary%602> and populates it with data in random order, then passes the <xref:System.Collections.Generic.SortedDictionary%602> to the <xref:System.Collections.Generic.Dictionary%602.%23ctor%28System.Collections.Generic.IEqualityComparer%7B%600%7D%29> constructor, creating a <xref:System.Collections.Generic.Dictionary%602> that is sorted. This is useful if you need to build a sorted dictionary that at some point becomes static; copying the data from a <xref:System.Collections.Generic.SortedDictionary%602> to a <xref:System.Collections.Generic.Dictionary%602> improves retrieval speed.
328328
329-
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.cs" interactive="try-dotnet" id="Snippet1":::
329+
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.cs" id="Snippet1":::
330330
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.fs" id="Snippet1":::
331331
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.vb" id="Snippet1":::
332332
@@ -455,7 +455,7 @@
455455
## Examples
456456
The following code example creates a <xref:System.Collections.Generic.Dictionary%602> with a case-insensitive equality comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in the dictionary.
457457
458-
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.cs" interactive="try-dotnet" id="Snippet1":::
458+
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.cs" id="Snippet1":::
459459
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.fs" id="Snippet1":::
460460
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb" id="Snippet1":::
461461
@@ -524,7 +524,7 @@
524524
## Examples
525525
The following code example creates a dictionary with an initial capacity of 4 and populates it with 4 entries.
526526
527-
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source3.cs" interactive="try-dotnet" id="Snippet1":::
527+
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source3.cs" id="Snippet1":::
528528
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source3.fs" id="Snippet1":::
529529
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source3.vb" id="Snippet1":::
530530
@@ -610,7 +610,7 @@
610610
> [!NOTE]
611611
> When you create a new dictionary with a case-insensitive comparer and populate it with entries from a dictionary that uses a case-sensitive comparer, as in this example, an exception occurs if the input dictionary has keys that differ only by case.
612612
613-
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
613+
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source1.cs" id="Snippet1":::
614614
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source1.fs" id="Snippet1":::
615615
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source1.vb" id="Snippet1":::
616616
@@ -753,7 +753,7 @@
753753
## Examples
754754
The following code example creates a <xref:System.Collections.Generic.Dictionary%602> with an initial capacity of 5 and a case-insensitive equality comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in the dictionary.
755755
756-
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source4.cs" interactive="try-dotnet" id="Snippet1":::
756+
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source4.cs" id="Snippet1":::
757757
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source4.fs" id="Snippet1":::
758758
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source4.vb" id="Snippet1":::
759759

0 commit comments

Comments
 (0)