List<T>.IList.IsReadOnly List<T>.IList.IsReadOnly List<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. List<T> 的預設實作中,這個屬性永遠會傳回 falseIn the default implementation of List<T>, this property always returns false.

實作

備註

唯讀的集合不允許在集合建立後增加、移除或修改項目。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.

適用於