ReadOnlyCollection<T>.IList.IsReadOnly 属性

定义

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

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

属性值

如果为只读,则为 否则为 /&;。 在默认实现中 ReadOnlyCollection<T>,此属性始终返回 true

实现

注解

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

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

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

此成员是显式接口成员实现。 仅当实例强制转换为ReadOnlyCollection<T>接口时IDisposable,才能使用它。

适用于