bool ICollection.IsSynchronized => false;
object ICollection.SyncRoot => this;
bool IDictionary.IsFixedSize => false;
bool IDictionary.IsReadOnly => false;
object IDictionary.this[object key]
{
get
{
if (IsCompatibleKey(key))
{
int idx = IndexOfKey((TKey)key);
if (idx >= 0) return values[idx];
}
return null;
}
set
{
VerifyKey(key); VerifyValueType(value);
// this[(TKey)key] = (TValue)value; // 暫屏蔽,待泛型索引器實作
}
}
ICollection IDictionary.Keys => GetKeyListHelper();
ICollection IDictionary.Values => GetValueListHelper();
此節集中呈現非泛型介面的屬性實作,方法成員見前節。所有顯式實作均委派給內部泛型邏輯,確保行為一致。