Collection<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

屬性值

如果 true 是唯讀,則為 IList,否則為 false。 在 Collection<T> 的預設實作中,這個屬性一律會傳回 false

實作

備註

唯讀的集合不允許在集合建立後增加、移除或修改項目。

唯讀的集合只是具有防止修改集合之包裝函式的集合;因此,如果對基礎集合進行變更,唯讀集合會反映這些變更。

擷取這個屬性的值是一種 O(1) 運算。

適用於