语言

CollectionBase.IList.IsReadOnly 属性

定义

获取一个值,该值指示是否 CollectionBase 为只读。

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

属性值

如果为只读,则为 否则为 /&;。 默认值为 false。

实现

注解

只读集合不允许在创建集合后添加、删除或修改元素。

只读的集合只是一个集合,其中包含阻止修改集合的包装器;因此,如果对基础集合进行了更改,只读集合将反映这些更改。

检索此属性的值是一项 O(1) 操作。

适用于