Dictionary<TKey,TValue>.ValueCollection.ICollection<TValue>.IsReadOnly Dictionary<TKey,TValue>.ValueCollection.ICollection<TValue>.IsReadOnly Dictionary<TKey,TValue>.ValueCollection.ICollection<TValue>.IsReadOnly Property

定义

获取一个值,该值指示 ICollection<T> 是否为只读。Gets a value indicating whether the ICollection<T> is read-only.

property bool System::Collections::Generic::ICollection<TValue>::IsReadOnly { bool get(); };
bool System.Collections.Generic.ICollection<TValue>.IsReadOnly { get; }
 ReadOnly Property IsReadOnly As Boolean Implements ICollection(Of TValue).IsReadOnly

属性值

如果 true 是只读的,则为 ICollection<T>;否则为 falsetrue if the ICollection<T> is read-only; otherwise, false. Dictionary<TKey,TValue>.ValueCollection 的默认实现中,此属性始终返回 trueIn the default implementation of Dictionary<TKey,TValue>.ValueCollection, this property always returns true.

实现

注解

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

检索此属性的值的运算复杂度为 O(1)。Retrieving the value of this property is an O(1) operation.

适用于