IDictionary<TKey,TValue>.Values Propriété

Définition

Obtient ICollection<T> contenant les valeurs de IDictionary<TKey,TValue>.Gets an ICollection<T> containing the values in the IDictionary<TKey,TValue>.

public:
 property System::Collections::Generic::ICollection<TValue> ^ Values { System::Collections::Generic::ICollection<TValue> ^ get(); };
public System.Collections.Generic.ICollection<TValue> Values { get; }
member this.Values : System.Collections.Generic.ICollection<'Value>
Public ReadOnly Property Values As ICollection(Of TValue)

Valeur de propriété

ICollection<TValue>

ICollection<T> contenant les valeurs de l'objet qui implémente IDictionary<TKey,TValue>.An ICollection<T> containing the values in the object that implements IDictionary<TKey,TValue>.

Exemples

L’exemple de code suivant montre comment énumérer uniquement des valeurs à Values l’aide de la propriété.The following code example shows how to enumerate values alone using the Values property.

Ce code fait partie d’un exemple plus complet qui peut être compilé et exécuté.This code is part of a larger example that can be compiled and executed. Consultez System.Collections.Generic.IDictionary<TKey,TValue>.See System.Collections.Generic.IDictionary<TKey,TValue>.

// To get the values alone, use the Values property.
ICollection<String^>^ icoll = openWith->Values;

// The elements of the ValueCollection are strongly typed
// with the type that was specified for dictionary values.
Console::WriteLine();
for each( String^ s in icoll )
{
    Console::WriteLine("Value = {0}", s);
}
// To get the values alone, use the Values property.
ICollection<string> icoll = openWith.Values;

// The elements of the ValueCollection are strongly typed
// with the type that was specified for dictionary values.
Console.WriteLine();
foreach( string s in icoll )
{
    Console.WriteLine("Value = {0}", s);
}
' To get the values alone, use the Values property.
Dim icoll As ICollection(Of String) = openWith.Values

' The elements of the ValueCollection are strongly typed
' with the type that was specified for dictionary values.
Console.WriteLine()
For Each s As String In  icoll
    Console.WriteLine("Value = {0}", s)
Next s

Remarques

L’ordre des valeurs dans le retourné ICollection<T> n’est pas spécifié, mais il est garanti qu’il s’agit du même ordre que les clés correspondantes dans le Keys ICollection<T> retourné par la propriété.The order of the values in the returned ICollection<T> is unspecified, but it is guaranteed to be the same order as the corresponding keys in the ICollection<T> returned by the Keys property.

S’applique à

Voir aussi