IDictionary<TKey,TValue>.Keys 속성

정의

ICollection<T>의 키를 포함하는 IDictionary<TKey,TValue>을 가져옵니다.

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

속성 값

ICollection<TKey>

ICollection<T>를 구현하는 개체의 키를 포함하는 IDictionary<TKey,TValue>입니다.

예제

다음 코드 예제를 사용 하 여 키만 열거 하는 방법을 보여 줌 속성 Keys 입니다.

이 코드는 컴파일 및 실행할 수 있는 더 큰 예제의 일부입니다. System.Collections.Generic.IDictionary<TKey,TValue>을 참조하세요.

// To get the keys alone, use the Keys property.
icoll = openWith->Keys;

// 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("Key = {0}", s);
}
// To get the keys alone, use the Keys property.
icoll = openWith.Keys;

// 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("Key = {0}", s);
}
' To get the keys alone, use the Keys property.
icoll = openWith.Keys

' 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("Key = {0}", s)
Next s

설명

반환 ICollection<T> 된 키의 순서는 지정되지 않지만 속성에서 반환 Values 된 의 해당 값 ICollection<T> 과 동일한 순서로 보장됩니다.

적용 대상

추가 정보