Dictionary<TKey,TValue>.IDictionary.IsFixedSize 属性
定义
获取一个值,该值指示 IDictionary 是否具有固定大小。Gets a value that indicates whether the IDictionary 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
属性值
如果 true 具有固定大小,则为 IDictionary;否则为 false。true if the IDictionary has a fixed size; otherwise, false. 在 Dictionary<TKey,TValue> 的默认实现中,此属性始终返回 false。In the default implementation of Dictionary<TKey,TValue>, this property always returns 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) 操作。Getting the value of this property is an O(1) operation.