HybridDictionary.IsReadOnly 属性

定义

获取一个值,用于指示 HybridDictionary 是否为只读。Gets a value indicating whether the HybridDictionary is read-only.

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

属性值

此属性始终返回 falseThis property always returns false.

实现

注解

HybridDictionary 实现 IsReadOnly 属性,因为 System.Collections.IDictionary 接口需要此属性。HybridDictionary implements the IsReadOnly property because it is required by the System.Collections.IDictionary interface.

在创建只读集合后,该集合不允许添加、移除或修改元素。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.

适用于