DictionaryBase.IDictionary.IsFixedSize 屬性


取得值,指出 DictionaryBase 物件是否具有固定的大小。Gets a value indicating whether a DictionaryBase object has a fixed size.

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



如果 DictionaryBase 物件有固定大小,則為 true,否則為 falsetrue if the DictionaryBase object 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 does allow 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.