Skip to content

P_Cyjb_Collections_ObjectModel_ReadOnlyDictionaryBase_2_Item

CYJB edited this page Mar 20, 2024 · 7 revisions

ReadOnlyDictionaryBase(TKey, TValue).Item 属性

获取或设置具有指定键的元素。

Namespace: Cyjb.Collections.ObjectModel
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6

语法

C#

public TValue this[
	TKey key
] { get; set; }

参数

 

key
Type: TKey
要获取或设置的元素的键。

返回值

Type: TValue
指定键对应的值。

实现

IDictionary(TKey, TValue).Item(TKey)
IReadOnlyDictionary(TKey, TValue).Item(TKey)

Exceptions

 

异常 条件
ArgumentNullException keynull
KeyNotFoundException 未找到指定的 key
NotSupportedException 设置时总是引发。

参见

Reference

ReadOnlyDictionaryBase(TKey, TValue) 类
Cyjb.Collections.ObjectModel 命名空间

Clone this wiki locally