Поделиться через


Структура ReadOnlyList<T>

Represents a generic structure that exposes the read-only interface of a list while hides its mutable interface.

Пространство имен:  Microsoft.SqlServer.Management.Sdk.Sfc
Сборка:  Microsoft.SqlServer.Management.Sdk.Sfc (в Microsoft.SqlServer.Management.Sdk.Sfc.dll)

Синтаксис

'Декларация
Public Structure ReadOnlyList(Of T) _
    Implements IReadOnlyList(Of T), IReadOnlyCollection(Of T),  _
    IReadOnlyCollection, IEnumerable(Of T), IEnumerable
'Применение
Dim instance As ReadOnlyList(Of T)
public struct ReadOnlyList<T> : IReadOnlyList<T>, 
    IReadOnlyCollection<T>, IReadOnlyCollection, IEnumerable<T>, IEnumerable
generic<typename T>
public value class ReadOnlyList : IReadOnlyList<T>, 
    IReadOnlyCollection<T>, IReadOnlyCollection, IEnumerable<T>, IEnumerable
[<SealedAttribute>]
type ReadOnlyList<'T> =  
    struct 
        interface IReadOnlyList<'T>
        interface IReadOnlyCollection<'T>
        interface IReadOnlyCollection 
        interface IEnumerable<'T>
        interface IEnumerable 
    end
JScript не поддерживает стандартные типы и методы.

Параметры типа

  • T
    The type of elements in the list.

Тип ReadOnlyList<T> обеспечивает доступ к следующим элементам.

Конструкторы

  Имя Описание
Открытый метод ReadOnlyList<T> Initializes a new instance of the ReadOnlyList<T> class with the specified list.

В начало

Свойства

  Имя Описание
Открытое свойство Count Gets the number of elements contained in the list.
Открытое свойство Item Gets the element at the specified index.

В начало

Методы

  Имя Описание
Открытый метод Contains Indicates whether the list contains a specific value.
Открытый метод CopyTo Copies the elements of the list to an array, starting at a particular array index.
Открытый метод Equals (Производный от ValueType.)
Открытый метод GetEnumerator Returns an enumerator that iterates through the list.
Открытый метод GetHashCode (Производный от ValueType.)
Открытый метод GetType (Производный от Object.)
Открытый метод IndexOf Determines the index of a specific item in the list.
Открытый метод ToString (Производный от ValueType.)

В начало

Операторы

  Имя Описание
Открытый операторСтатический элемент Implicit(List<T> to ReadOnlyList<T>) Returns an implicit conversion from a list to a read only list.
Открытый операторСтатический элемент Implicit(array<T[] to ReadOnlyList<T>) Returns an implicit conversion from an array to a list.

В начало

Явные реализации интерфейса

  Имя Описание
Явная реализация интерфейсаЗакрытый метод IEnumerable.GetEnumerator Returns an enumerator that iterates through the list.

В начало

Безопасность многопоточности

Любые открытые статический (Shared в Visual Basic) элементы этого типа потокобезопасны. Потокобезопасность с элементами экземпляров не гарантируется.

См. также

Справочник

Пространство имен Microsoft.SqlServer.Management.Sdk.Sfc