Lookup<TKey,TElement>.Item[TKey] 속성

정의

지정된 키로 인덱싱된 값의 컬렉션을 가져옵니다.

public:
 property System::Collections::Generic::IEnumerable<TElement> ^ default[TKey] { System::Collections::Generic::IEnumerable<TElement> ^ get(TKey key); };
public System.Collections.Generic.IEnumerable<TElement> this[TKey key] { get; }
member this.Item('Key) : seq<'Element>
Default Public ReadOnly Property Item(key As TKey) As IEnumerable(Of TElement)

매개 변수

key
TKey

원하는 값 컬렉션의 키입니다.

속성 값

IEnumerable<TElement>

지정된 키로 인덱싱된 값의 컬렉션입니다.

구현

예제

다음 예제에서는 를 사용하여 Item[] 에 직접 인덱싱하는 방법을 보여 줍니다 Lookup<TKey,TElement>. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 Lookup<TKey,TElement> 클래스입니다.

// Select a collection of Packages by indexing directly into the Lookup.
IEnumerable<string> cgroup = lookup['C'];
' Select a collection of Packages by indexing directly into the Lookup.
Dim cgroup As System.Collections.Generic.IEnumerable(Of String) = lookup("C"c)

설명

이 인덱싱된 속성은 Visual C# 또는 myLookup(key) Visual Basic의 구문을 myLookup[key] 사용하여 의 특정 값 Lookup<TKey,TElement> 컬렉션을 인덱싱하는 기능을 제공합니다. 컬렉션에서 를 key 찾을 수 없으면 빈 시퀀스가 반환됩니다.

적용 대상