IDictionary<TKey,TValue>.Values Właściwość

Definicja

Pobiera element ICollection<T> zawierający wartości w obiekcie 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)

Wartość właściwości

ICollection<TValue>

Obiekt ICollection<T> zawierający wartości w obiekcie, który implementuje IDictionary<TKey,TValue>element .

Przykłady

W poniższym przykładzie kodu pokazano, jak wyliczać wartości samodzielnie przy użyciu Values właściwości .

Ten kod jest częścią większego przykładu, który można skompilować i wykonać. Zobacz: .

// 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

Uwagi

Kolejność wartości zwróconych ICollection<T> jest nieokreślona, ale gwarantowana jest taka sama kolejność, jak odpowiednie klucze w ICollection<T> zwróconej Keys przez właściwość .

Dotyczy

Zobacz też