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.

页首

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。

请参阅

参考

Microsoft.SqlServer.Management.Sdk.Sfc 命名空间