📜  添加到字典类 c# 代码示例

📅  最后修改于: 2022-03-11 14:49:08.647000             🧑  作者: Mango

代码示例3
public TValue this[TKey key]
{
    get
    {
        int index = this.FindEntry(key);
        if (index >= 0)
        {
            return this.entries[index].value;
        }
        ThrowHelper.ThrowKeyNotFoundException();
        return default(TValue);
    }
    set
    {
        this.Insert(key, value, false);
    }
}