ArrangedElementCollection.IsReadOnly 属性

定义

获取一个值,该值指示集合是否为只读。Gets a value indicating whether the collection is read-only.

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

属性值

如果该集合为只读,则为 true;否则为 falsetrue if the collection is read-only; otherwise, false. 默认值为 falseThe default is false.

实现

注解

在创建集合后, 只读集合不允许添加、移除或修改元素。A read-only collection does not allow the addition, removal, or modification of elements after the collection is created.

只读集合就是一个集合, 其中包含阻止修改集合的包装器。A read-only collection is simply a collection with a wrapper that prevents modifying the collection. 如果对基础集合进行了更改, 只读集合将反映这些更改。If changes are made to the underlying collection, the read-only collection reflects those changes.

适用于

另请参阅