Dictionary<TKey,TValue>.IDictionary.IsReadOnly Dictionary<TKey,TValue>.IDictionary.IsReadOnly Dictionary<TKey,TValue>.IDictionary.IsReadOnly Property


取得值,這個值表示 IDictionary 是否為唯讀。Gets a value that indicates whether the IDictionary is read-only.

property bool System::Collections::IDictionary::IsReadOnly { bool get(); };
bool System.Collections.IDictionary.IsReadOnly { get; }
 ReadOnly Property IsReadOnly As Boolean Implements IDictionary.IsReadOnly


如果 true 是唯讀,則為 IDictionary,否則為 falsetrue if the IDictionary is read-only; otherwise, false. Dictionary<TKey,TValue> 的預設實作中,這個屬性永遠會傳回 falseIn the default implementation of Dictionary<TKey,TValue>, this property always returns false.



唯讀的集合不允許在集合建立後增加、移除或修改項目。A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created.

唯讀的集合只是具有包裝函式的集合,可防止修改集合;因此,如果對基礎集合進行了變更,唯讀集合就會反映這些變更。A collection that is read-only is simply a collection with a wrapper that prevents modifying the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes.

取得這個屬性的值是 O (1)運算。Getting the value of this property is an O(1) operation.