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


Gets a value indicating whether the ICollection<T> is read-only.

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

Property Value


true if the ICollection<T> is read-only; otherwise, false. In the default implementation of Dictionary<TKey,TValue>.KeyCollection, 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.

Retrieving the value of this property is an O(1) operation.

Applies to