Skip to content

Commit 23387a2

Browse files
authored
Remove interactive snippets (#12093)
This PR removes interactive snippets from every namespace except `System`.
1 parent 97baddc commit 23387a2

File tree

79 files changed

+520
-520
lines changed

Some content is hidden

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

79 files changed

+520
-520
lines changed

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

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

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,24 @@
7676
<typeparam name="T">The type of objects to compare.</typeparam>
7777
<summary>Provides a base class for implementations of the <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> generic interface.</summary>
7878
<remarks>
79-
<format type="text/markdown"><![CDATA[
80-
81-
## Remarks
82-
83-
Derive from this class to provide a custom implementation of the <xref:System.Collections.Generic.IEqualityComparer%601> generic interface for use with collection classes such as the <xref:System.Collections.Generic.Dictionary%602> generic class, or with methods such as <xref:System.Collections.Generic.List%601.Sort%2A?displayProperty=nameWithType>.
84-
85-
The <xref:System.Collections.Generic.EqualityComparer%601.Default%2A> property checks whether type `T` implements the <xref:System.IEquatable%601?displayProperty=nameWithType> generic interface and, if so, returns an <xref:System.Collections.Generic.EqualityComparer%601> that invokes the implementation of the <xref:System.IEquatable%601.Equals%2A?displayProperty=nameWithType> method. Otherwise, it returns an <xref:System.Collections.Generic.EqualityComparer%601>, as provided by `T`.
86-
87-
In .NET 8 and later versions, we recommend using the <xref:System.Collections.Generic.EqualityComparer%601.Create(System.Func{%600,%600,System.Boolean},System.Func{%600,System.Int32})?displayProperty=nameWithType> method to create instances of this type.
88-
89-
## Examples
90-
The following example creates a dictionary collection of objects of type `Box` with an equality comparer. Two boxes are considered equal if their dimensions are the same. It then adds the boxes to the collection.
91-
92-
The dictionary is recreated with an equality comparer that defines equality in a different way: Two boxes are considered equal if their volumes are the same.
93-
94-
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/EqualityComparerT/Overview/program.cs" interactive="try-dotnet" id="Snippet1":::
95-
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/EqualityComparerT/Overview/program.vb" id="Snippet1":::
96-
79+
<format type="text/markdown"><![CDATA[
80+
81+
## Remarks
82+
83+
Derive from this class to provide a custom implementation of the <xref:System.Collections.Generic.IEqualityComparer%601> generic interface for use with collection classes such as the <xref:System.Collections.Generic.Dictionary%602> generic class, or with methods such as <xref:System.Collections.Generic.List%601.Sort%2A?displayProperty=nameWithType>.
84+
85+
The <xref:System.Collections.Generic.EqualityComparer%601.Default%2A> property checks whether type `T` implements the <xref:System.IEquatable%601?displayProperty=nameWithType> generic interface and, if so, returns an <xref:System.Collections.Generic.EqualityComparer%601> that invokes the implementation of the <xref:System.IEquatable%601.Equals%2A?displayProperty=nameWithType> method. Otherwise, it returns an <xref:System.Collections.Generic.EqualityComparer%601>, as provided by `T`.
86+
87+
In .NET 8 and later versions, we recommend using the <xref:System.Collections.Generic.EqualityComparer%601.Create(System.Func{%600,%600,System.Boolean},System.Func{%600,System.Int32})?displayProperty=nameWithType> method to create instances of this type.
88+
89+
## Examples
90+
The following example creates a dictionary collection of objects of type `Box` with an equality comparer. Two boxes are considered equal if their dimensions are the same. It then adds the boxes to the collection.
91+
92+
The dictionary is recreated with an equality comparer that defines equality in a different way: Two boxes are considered equal if their volumes are the same.
93+
94+
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/EqualityComparerT/Overview/program.cs" id="Snippet1":::
95+
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/EqualityComparerT/Overview/program.vb" id="Snippet1":::
96+
9797
]]></format>
9898
</remarks>
9999
<altmember cref="T:System.Collections.Generic.IEqualityComparer`1" />
@@ -180,7 +180,7 @@ In .NET 8 and later versions, we recommend using the <xref:System.Collections.Ge
180180
</Parameters>
181181
<Docs>
182182
<param name="equals">The delegate to use to implement the <see cref="M:System.Collections.Generic.EqualityComparer`1.Equals(`0,`0)" /> method.</param>
183-
<param name="getHashCode">The delegate to use to implement the <see cref="M:System.Collections.Generic.EqualityComparer`1.GetHashCode(`0)" /> method.
183+
<param name="getHashCode">The delegate to use to implement the <see cref="M:System.Collections.Generic.EqualityComparer`1.GetHashCode(`0)" /> method.
184184
If no delegate is supplied, calls to the resulting comparer's <see cref="M:System.Collections.Generic.EqualityComparer`1.GetHashCode(`0)" /> will throw <see cref="T:System.NotSupportedException" />.</param>
185185
<summary>Creates an <see cref="T:System.Collections.Generic.EqualityComparer`1" /> by using the specified delegates as the implementation of the comparer's <see cref="M:System.Collections.Generic.EqualityComparer`1.Equals(`0,`0)" /> and <see cref="M:System.Collections.Generic.EqualityComparer`1.GetHashCode(`0)" /> methods.</summary>
186186
<returns>The new comparer.</returns>
@@ -238,23 +238,23 @@ In .NET 8 and later versions, we recommend using the <xref:System.Collections.Ge
238238
<summary>Returns a default equality comparer for the type specified by the generic argument.</summary>
239239
<value>The default instance of the <see cref="T:System.Collections.Generic.EqualityComparer`1" /> class for type <typeparamref name="T" />.</value>
240240
<remarks>
241-
<format type="text/markdown"><![CDATA[
242-
243-
## Remarks
244-
The <xref:System.Collections.Generic.EqualityComparer%601.Default%2A> property checks whether type `T` implements the <xref:System.IEquatable%601?displayProperty=nameWithType> interface and, if so, returns an <xref:System.Collections.Generic.EqualityComparer%601> that uses that implementation. Otherwise, it returns an <xref:System.Collections.Generic.EqualityComparer%601> that uses the overrides of <xref:System.Object.Equals%2A?displayProperty=nameWithType> and <xref:System.Object.GetHashCode%2A?displayProperty=nameWithType> provided by `T`.
245-
246-
247-
248-
## Examples
249-
The following example creates a collection that contains elements of the `Box` type and then searches it for a box matching another box by calling the `FindFirst` method, twice.
250-
251-
The first search does not specify any equality comparer, which means `FindFirst` uses <xref:System.Collections.Generic.EqualityComparer%601.Default%2A?displayProperty=nameWithType> to determine equality of boxes. That in turn uses the implementation of the <xref:System.IEquatable%601.Equals%2A?displayProperty=nameWithType> method in the `Box` class. Two boxes are considered equal if their dimensions are the same.
252-
253-
The second search specifies an equality comparer (`BoxEqVolume`) that defines equality by volume. Two boxes are considered equal if their volumes are the same.
254-
255-
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/EqualityComparerT/Default/program.cs" interactive="try-dotnet":::
256-
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/EqualityComparerT/Default/program.vb":::
257-
241+
<format type="text/markdown"><![CDATA[
242+
243+
## Remarks
244+
The <xref:System.Collections.Generic.EqualityComparer%601.Default%2A> property checks whether type `T` implements the <xref:System.IEquatable%601?displayProperty=nameWithType> interface and, if so, returns an <xref:System.Collections.Generic.EqualityComparer%601> that uses that implementation. Otherwise, it returns an <xref:System.Collections.Generic.EqualityComparer%601> that uses the overrides of <xref:System.Object.Equals%2A?displayProperty=nameWithType> and <xref:System.Object.GetHashCode%2A?displayProperty=nameWithType> provided by `T`.
245+
246+
247+
248+
## Examples
249+
The following example creates a collection that contains elements of the `Box` type and then searches it for a box matching another box by calling the `FindFirst` method, twice.
250+
251+
The first search does not specify any equality comparer, which means `FindFirst` uses <xref:System.Collections.Generic.EqualityComparer%601.Default%2A?displayProperty=nameWithType> to determine equality of boxes. That in turn uses the implementation of the <xref:System.IEquatable%601.Equals%2A?displayProperty=nameWithType> method in the `Box` class. Two boxes are considered equal if their dimensions are the same.
252+
253+
The second search specifies an equality comparer (`BoxEqVolume`) that defines equality by volume. Two boxes are considered equal if their volumes are the same.
254+
255+
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/EqualityComparerT/Default/program.cs" interactive="try-dotnet":::
256+
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/EqualityComparerT/Default/program.vb":::
257+
258258
]]></format>
259259
</remarks>
260260
<altmember cref="T:System.Collections.Generic.IEqualityComparer`1" />
@@ -327,11 +327,11 @@ In .NET 8 and later versions, we recommend using the <xref:System.Collections.Ge
327327
<returns>
328328
<see langword="true" /> if the specified objects are equal; otherwise, <see langword="false" />.</returns>
329329
<remarks>
330-
<format type="text/markdown"><![CDATA[
331-
332-
## Remarks
333-
The <xref:System.Collections.Generic.EqualityComparer%601.Equals%2A> method is reflexive, symmetric, and transitive. That is, it returns `true` if used to compare an object with itself; `true` for two objects `x` and `y` if it is `true` for `y` and `x`; and `true` for two objects `x` and `z` if it is `true` for `x` and `y` and also `true` for `y` and `z`.
334-
330+
<format type="text/markdown"><![CDATA[
331+
332+
## Remarks
333+
The <xref:System.Collections.Generic.EqualityComparer%601.Equals%2A> method is reflexive, symmetric, and transitive. That is, it returns `true` if used to compare an object with itself; `true` for two objects `x` and `y` if it is `true` for `y` and `x`; and `true` for two objects `x` and `z` if it is `true` for `x` and `y` and also `true` for `y` and `z`.
334+
335335
]]></format>
336336
</remarks>
337337
<block subset="none" type="overrides">
@@ -449,13 +449,13 @@ In .NET 8 and later versions, we recommend using the <xref:System.Collections.Ge
449449
<returns>
450450
<see langword="true" /> if the specified objects are equal; otherwise, <see langword="false" />.</returns>
451451
<remarks>
452-
<format type="text/markdown"><![CDATA[
453-
454-
## Remarks
455-
This method is a wrapper for the <xref:System.Collections.Generic.EqualityComparer%601.Equals%28%600%2C%600%29> method, so `obj` must be cast to the type specified by the generic argument `T` of the current instance. If it cannot be cast to `T`, an <xref:System.ArgumentException> is thrown.
456-
457-
Comparing `null` is allowed and does not generate an exception.
458-
452+
<format type="text/markdown"><![CDATA[
453+
454+
## Remarks
455+
This method is a wrapper for the <xref:System.Collections.Generic.EqualityComparer%601.Equals%28%600%2C%600%29> method, so `obj` must be cast to the type specified by the generic argument `T` of the current instance. If it cannot be cast to `T`, an <xref:System.ArgumentException> is thrown.
456+
457+
Comparing `null` is allowed and does not generate an exception.
458+
459459
]]></format>
460460
</remarks>
461461
<exception cref="T:System.ArgumentException">
@@ -509,17 +509,17 @@ In .NET 8 and later versions, we recommend using the <xref:System.Collections.Ge
509509
<summary>Returns a hash code for the specified object.</summary>
510510
<returns>A hash code for the specified object.</returns>
511511
<remarks>
512-
<format type="text/markdown"><![CDATA[
513-
514-
## Remarks
515-
This method is a wrapper for the <xref:System.Collections.Generic.EqualityComparer%601.GetHashCode%28%600%29> method, so `obj` must be a type that can be cast to the type specified by the generic type argument `T` of the current instance.
516-
512+
<format type="text/markdown"><![CDATA[
513+
514+
## Remarks
515+
This method is a wrapper for the <xref:System.Collections.Generic.EqualityComparer%601.GetHashCode%28%600%29> method, so `obj` must be a type that can be cast to the type specified by the generic type argument `T` of the current instance.
516+
517517
]]></format>
518518
</remarks>
519-
<exception cref="T:System.ArgumentNullException">The type of <paramref name="obj" /> is a reference type and <paramref name="obj" /> is <see langword="null" />.
520-
521-
-or-
522-
519+
<exception cref="T:System.ArgumentNullException">The type of <paramref name="obj" /> is a reference type and <paramref name="obj" /> is <see langword="null" />.
520+
521+
-or-
522+
523523
<paramref name="obj" /> is of a type that cannot be cast to type <typeparamref name="T" />.</exception>
524524
</Docs>
525525
</Member>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
8383
This example also implements an <xref:System.Collections.Generic.IEnumerator%601> interface for the `BoxCollection` class so that the collection can be enumerated.
8484
85-
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ICollectionT/Overview/program.cs" interactive="try-dotnet" id="Snippet1":::
85+
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ICollectionT/Overview/program.cs" id="Snippet1":::
8686
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ICollectionT/Overview/program.vb" id="Snippet1":::
8787
8888
]]></format>

0 commit comments

Comments
 (0)