ReadOnlyList<T> 結構

定義

一個通用結構體,能暴露串列的唯讀介面,同時隱藏其可變介面。

public struct ReadOnlyList<T> : Microsoft.SqlServer.Management.Sdk.Sfc.IReadOnlyCollection<T>, Microsoft.SqlServer.Management.Sdk.Sfc.IReadOnlyList<T>, System.Collections.Generic.IEnumerable<T>
type ReadOnlyList<'T> = struct
    interface seq<'T>
    interface IEnumerable
    interface IReadOnlyList<'T>
    interface IReadOnlyCollection<'T>
    interface IReadOnlyCollection
Public Structure ReadOnlyList(Of T)
Implements IEnumerable(Of T), IReadOnlyCollection(Of T), IReadOnlyList(Of T)

類型參數

T

清單中的項目類型。

繼承
ReadOnlyList<T>
實作

建構函式

名稱 Description
ReadOnlyList<T>(IList<T>)

初始化一個新的實例 ReadOnlyList<T> ,將指定的 IList<T> 資料包裹在唯讀介面中。

屬性

名稱 Description
Count

得到包含於 的 ReadOnlyList<T>元素數量。

Item[Int32]

取得位於指定索引處的專案。

方法

名稱 Description
Contains(T)

判斷是否 ReadOnlyList<T> 包含特定值。

CopyTo(T[], Int32)

從特定 ReadOnlyList<T> 索引開始,將 Array 的專案複製到 Array

GetEnumerator()

回傳一個遍歷清單的列舉器。

IndexOf(T)

決定特定項目的 ReadOnlyList<T>索引。

運算子

名稱 Description
Implicit(List<T> to ReadOnlyList<T>)

一個通用結構體,能暴露串列的唯讀介面,同時隱藏其可變介面。

Implicit(T[] to ReadOnlyList<T>)

一個通用結構體,能暴露串列的唯讀介面,同時隱藏其可變介面。

明確介面實作

名稱 Description
IEnumerable.GetEnumerator()

回傳一個遍歷清單的列舉器。

適用於