MatchCollection.IsReadOnly 属性
定义
获取一个值,指示集合是否为只读集合。Gets a value that indicates whether the collection is read only.
public:
property bool IsReadOnly { bool get(); };
public bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public ReadOnly Property IsReadOnly As Boolean
属性值
在所有情况下均为 true。true in all cases.
实现
注解
只读集合不允许在创建集合后添加或删除元素。A collection that is read-only does not allow the addition or removal of elements after the collection is created. 请注意,此上下文中的只读操作不指示是否可修改集合中的单个元素,因为 ICollection<T> 接口仅支持添加和删除操作。Note that read-only in this context does not indicate whether individual elements of the collection can be modified, since the ICollection<T> interface only supports addition and removal operations. 例如, IsReadOnly 强制转换或转换为对象的数组的属性将 ICollection<T> 返回 true ,即使可以修改单个数组元素也是如此。For example, the IsReadOnly property of an array that is cast or converted to an ICollection<T> object returns true, even though individual array elements can be modified.