Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions xml/System.Collections.Specialized/ListDictionary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@
A key cannot be `null`, but a value can.

The `foreach` statement of the C# language (`for each` in Visual Basic) returns an object of the type of the elements in the collection. Since each element of the <xref:System.Collections.Specialized.ListDictionary> is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is <xref:System.Collections.DictionaryEntry>. For example:
[!code-cpp[System.Collections.Specialized.ListDictionary2#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CPP/source2.cpp#3)]
[!code-csharp[System.Collections.Specialized.ListDictionary2#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CS/source2.cs#3)]
[!code-vb[System.Collections.Specialized.ListDictionary2#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/VB/source2.vb#3)]

:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CPP/source2.cpp" id="Snippet3":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CS/source2.cs" id="Snippet3":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/VB/source2.vb" id="Snippet3":::

The `foreach` statement is a wrapper around the enumerator, which only allows reading from, not writing to, the collection.



## Examples
The following code example demonstrates several of the properties and methods of <xref:System.Collections.Specialized.ListDictionary>.

[!code-cpp[System.Collections.Specialized.ListDictionary2#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CPP/listdictionary.cpp#1)]
[!code-csharp[System.Collections.Specialized.ListDictionary2#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CS/listdictionary.cs#1)]
[!code-vb[System.Collections.Specialized.ListDictionary2#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/VB/listdictionary.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CPP/listdictionary.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CS/listdictionary.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/VB/listdictionary.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -277,10 +277,10 @@
## Examples
The following code example adds to and removes elements from a <xref:System.Collections.Specialized.ListDictionary>.

[!code-cpp[System.Collections.Specialized.ListDictionary_AddRemove#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/CPP/listdictionary_addremove.cpp#1)]
[!code-csharp[System.Collections.Specialized.ListDictionary_AddRemove#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/CS/listdictionary_addremove.cs#1)]
[!code-vb[System.Collections.Specialized.ListDictionary_AddRemove#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/VB/listdictionary_addremove.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/CPP/listdictionary_addremove.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/CS/listdictionary_addremove.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/VB/listdictionary_addremove.vb" id="Snippet1":::

]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
Expand Down Expand Up @@ -407,9 +407,9 @@
## Examples
The following code example searches for an element in a <xref:System.Collections.Specialized.ListDictionary>.

[!code-cpp[System.Collections.Specialized.ListDictionary_Contains#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Contains/CPP/listdictionary_contains.cpp#1)]
[!code-csharp[System.Collections.Specialized.ListDictionary_Contains#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Contains/CS/listdictionary_contains.cs#1)]
[!code-vb[System.Collections.Specialized.ListDictionary_Contains#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Contains/VB/listdictionary_contains.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Contains/CPP/listdictionary_contains.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Contains/CS/listdictionary_contains.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Contains/VB/listdictionary_contains.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -870,9 +870,9 @@
## Examples
The following code example enumerates the elements of a <xref:System.Collections.Specialized.ListDictionary>.

[!code-cpp[System.Collections.Specialized.ListDictionary_Enumerator#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/CPP/listdictionary_enumerator.cpp#1)]
[!code-csharp[System.Collections.Specialized.ListDictionary_Enumerator#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/CS/listdictionary_enumerator.cs#1)]
[!code-vb[System.Collections.Specialized.ListDictionary_Enumerator#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/VB/listdictionary_enumerator.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/CPP/listdictionary_enumerator.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/CS/listdictionary_enumerator.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/VB/listdictionary_enumerator.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -1001,7 +1001,7 @@

[!code-cpp[System.Collections.Specialized.ListDictionary_AddRemove#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/CPP/listdictionary_addremove.cpp#1)]
[!code-csharp[System.Collections.Specialized.ListDictionary_AddRemove#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/CS/listdictionary_addremove.cs#1)]
[!code-vb[System.Collections.Specialized.ListDictionary_AddRemove#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/VB/listdictionary_addremove.vb#1)]
[!code-vb[System.Collections.Specialized.ListDictionary_AddRemove#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_AddRemove/VB/listdictionary_addremove.vb#1)]

]]></format>
</remarks>
Expand Down
48 changes: 24 additions & 24 deletions xml/System.Collections.Specialized/StringCollection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
## Examples
The following code example demonstrates several of the properties and methods of <xref:System.Collections.Specialized.StringCollection>.

[!code-cpp[System.Collections.Specialized.StringCollection2#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/CPP/stringcollection.cpp#1)]
[!code-csharp[System.Collections.Specialized.StringCollection2#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/CS/stringcollection.cs#1)]
[!code-vb[System.Collections.Specialized.StringCollection2#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/VB/stringcollection.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/CPP/stringcollection.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/CS/stringcollection.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/VB/stringcollection.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -171,9 +171,9 @@
## Examples
The following code example adds new elements to the <xref:System.Collections.Specialized.StringCollection>.

[!code-cpp[System.Collections.Specialized.StringCollectionAdd#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/CPP/stringcollectionadd.cpp#1)]
[!code-csharp[System.Collections.Specialized.StringCollectionAdd#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/CS/stringcollectionadd.cs#1)]
[!code-vb[System.Collections.Specialized.StringCollectionAdd#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/VB/stringcollectionadd.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/CPP/stringcollectionadd.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/CS/stringcollectionadd.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/VB/stringcollectionadd.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -232,9 +232,9 @@
## Examples
The following code example adds new elements to the <xref:System.Collections.Specialized.StringCollection>.

[!code-cpp[System.Collections.Specialized.StringCollectionAdd#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/CPP/stringcollectionadd.cpp#1)]
[!code-csharp[System.Collections.Specialized.StringCollectionAdd#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/CS/stringcollectionadd.cs#1)]
[!code-vb[System.Collections.Specialized.StringCollectionAdd#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/VB/stringcollectionadd.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/CPP/stringcollectionadd.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/CS/stringcollectionadd.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionAdd/VB/stringcollectionadd.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -361,9 +361,9 @@
## Examples
The following code example searches the <xref:System.Collections.Specialized.StringCollection> for an element.

[!code-cpp[System.Collections.Specialized.StringCollectionContains#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/CPP/stringcollectioncontains.cpp#1)]
[!code-csharp[System.Collections.Specialized.StringCollectionContains#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/CS/stringcollectioncontains.cs#1)]
[!code-vb[System.Collections.Specialized.StringCollectionContains#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/VB/stringcollectioncontains.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/CPP/stringcollectioncontains.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/CS/stringcollectioncontains.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/VB/stringcollectioncontains.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -426,9 +426,9 @@
## Examples
The following code example copies a <xref:System.Collections.Specialized.StringCollection> to an array.

[!code-cpp[System.Collections.Specialized.StringCollectionCopyTo#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionCopyTo/CPP/stringcollectioncopyto.cpp#1)]
[!code-csharp[System.Collections.Specialized.StringCollectionCopyTo#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionCopyTo/CS/stringcollectioncopyto.cs#1)]
[!code-vb[System.Collections.Specialized.StringCollectionCopyTo#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionCopyTo/VB/stringcollectioncopyto.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionCopyTo/CPP/stringcollectioncopyto.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionCopyTo/CS/stringcollectioncopyto.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionCopyTo/VB/stringcollectioncopyto.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -622,9 +622,9 @@
## Examples
The following code example searches the <xref:System.Collections.Specialized.StringCollection> for an element.

[!code-cpp[System.Collections.Specialized.StringCollectionContains#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/CPP/stringcollectioncontains.cpp#1)]
[!code-csharp[System.Collections.Specialized.StringCollectionContains#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/CS/stringcollectioncontains.cs#1)]
[!code-vb[System.Collections.Specialized.StringCollectionContains#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/VB/stringcollectioncontains.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/CPP/stringcollectioncontains.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/CS/stringcollectioncontains.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionContains/VB/stringcollectioncontains.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -939,9 +939,9 @@
## Examples
The following code example removes elements from the <xref:System.Collections.Specialized.StringCollection>.

[!code-cpp[System.Collections.Specialized.StringCollectionRemove#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/CPP/stringcollectionremove.cpp#1)]
[!code-csharp[System.Collections.Specialized.StringCollectionRemove#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/CS/stringcollectionremove.cs#1)]
[!code-vb[System.Collections.Specialized.StringCollectionRemove#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/VB/stringcollectionremove.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/CPP/stringcollectionremove.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/CS/stringcollectionremove.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/VB/stringcollectionremove.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down Expand Up @@ -1002,9 +1002,9 @@
## Examples
The following code example removes elements from the <xref:System.Collections.Specialized.StringCollection>.

[!code-cpp[System.Collections.Specialized.StringCollectionRemove#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/CPP/stringcollectionremove.cpp#1)]
[!code-csharp[System.Collections.Specialized.StringCollectionRemove#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/CS/stringcollectionremove.cs#1)]
[!code-vb[System.Collections.Specialized.StringCollectionRemove#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/VB/stringcollectionremove.vb#1)]
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/CPP/stringcollectionremove.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/CS/stringcollectionremove.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollectionRemove/VB/stringcollectionremove.vb" id="Snippet1":::

]]></format>
</remarks>
Expand Down