StringCollection.IList.IsReadOnly 属性

定义

获取一个值,该值指示 StringCollection 对象是否为只读。

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

属性值

Boolean

如果 StringCollection 对象为只读,则为 true;否则为 false。 默认值为 false

实现

注解

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

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

检索此属性的值的运算复杂度为 O(1)。

适用于