Hashtable.IsReadOnly 屬性

定義

取得值,指出 Hashtable 是否唯讀。Gets a value indicating whether the Hashtable is read-only.

public:
 virtual property bool IsReadOnly { bool get(); };
public virtual bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public Overridable ReadOnly Property IsReadOnly As Boolean

屬性值

Boolean

如果 true 是唯讀,則為 Hashtable,否則為 falsetrue if the Hashtable is read-only; otherwise, false. 預設為 falseThe default is 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)Retrieving the value of this property is an O(1) operation.

適用於