IDictionary<TKey,TValue>.Values Eigenschaft

Definition

Ruft eine ICollection<T> ab, die die Werte im IDictionary<TKey,TValue> enthält.

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)

Eigenschaftswert

ICollection<TValue>

Eine ICollection<T>, die die Werte des Objekts enthält, das IDictionary<TKey,TValue> implementiert.

Beispiele

Im folgenden Codebeispiel wird gezeigt, wie Werte allein mithilfe der Values -Eigenschaft aufgelistet werden.

Dieser Code ist Teil eines größeren Beispiels, das kompiliert und ausgeführt werden kann. Siehe 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

Hinweise

Die Reihenfolge der zurückgegebenen ICollection<T> Werte ist nicht angegeben, aber es wird garantiert, dass sie dieselbe Reihenfolge wie die entsprechenden Schlüssel in der ICollection<T> von der Keys -Eigenschaft zurückgegebenen schlüssel aufweist.

Gilt für:

Weitere Informationen