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)

注釈

このインデックス付きプロパティの値の特定のコレクションのインデックスを作成する機能を提供する、 Lookup<TKey,TElement> 、次の構文を使用して: myLookup[key] Visual C# またはmyLookup(key)Visual Basic でします。 keyがコレクションに見つからない場合は、空のシーケンスが返されます。

適用対象