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) 成员都是线程安全的。不保证所有实例成员都是线程安全的。