📜  如何在 C# 代码示例中的字典中添加对象

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

代码示例1
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);
    }
}