ReadOnlyCollection<T>.IList.IsReadOnly ReadOnlyCollection<T>.IList.IsReadOnly ReadOnlyCollection<T>.IList.IsReadOnly Property

定義

取得值,指出 IList 是否唯讀。Gets a value indicating whether the IList is read-only.

property bool System::Collections::IList::IsReadOnly { bool get(); };
bool System.Collections.IList.IsReadOnly { get; }
 ReadOnly Property IsReadOnly As Boolean Implements IList.IsReadOnly

屬性值

如果 true 是唯讀,則為 IList,否則為 falsetrue if the IList is read-only; otherwise, false. ReadOnlyCollection<T> 的預設實作中,這個屬性永遠會傳回 trueIn the default implementation of ReadOnlyCollection<T>, 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.

唯讀的集合只是具有包裝函式的集合, 可防止修改集合;因此, 如果對基礎集合進行了變更, 唯讀集合就會反映這些變更。A collection that is read-only is simply a collection with a wrapper that prevents modifying the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes.

擷取這個屬性的值是一種 O(1) 運算。Retrieving the value of this property is an O(1) operation.

這個成員是明確介面成員實作,This member is an explicit interface member implementation. 只有在 ReadOnlyCollection<T> 執行個體轉換成 IDisposable 介面時,才能使用這個成員。It can be used only when the ReadOnlyCollection<T> instance is cast to an IDisposable interface.

適用於