Hashtable.IsFixedSize 屬性

定義

取得值,指出 Hashtable 是否有固定的大小。Gets a value indicating whether the Hashtable has a fixed size.

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

屬性值

Boolean

如果 true 有固定的大小,即為 Hashtable;否則為 falsetrue if the Hashtable has a fixed size; otherwise, false. 預設為 falseThe default is false.

實作

備註

具有固定大小的集合不允許在集合建立後新增或移除項目,但允許對現有項目進行修改。A collection with a fixed size does not allow the addition or removal of elements after the collection is created, but it allows the modification of existing elements.

具有固定大小的集合只是具有包裝函式的集合,可防止新增和移除元素;因此,如果對基礎集合進行了變更,包括新增或移除專案,則固定大小的集合會反映這些變更。A collection with a fixed size is simply a collection with a wrapper that prevents adding and removing elements; therefore, if changes are made to the underlying collection, including the addition or removal of elements, the fixed-size collection reflects those changes.

抓取這個屬性的值是一項作業 O(1)Retrieving the value of this property is an O(1) operation.

適用於