ReadOnlyDictionary<TKey,TValue>.Item[TKey] 屬性

定義

取得具有指定之索引鍵的項目。Gets the element that has the specified key.

public:
 property TValue default[TKey] { TValue get(TKey key); };
public TValue this[TKey key] { get; }
member this.Item('Key) : 'Value
Default Public ReadOnly Property Item(key As TKey) As TValue

參數

key
TKey

要取得的元素索引鍵。The key of the element to get.

屬性值

TValue

具有指定索引鍵的項目。The element that has the specified key.

實作

例外狀況

keynullkey is null.

屬性已擷取,並且找不到 keyThe property is retrieved and key is not found.

適用於