SynchronizedReadOnlyCollection<T> 构造函数

定义

初始化 SynchronizedReadOnlyCollection<T> 类的新实例。Initializes a new instance of the SynchronizedReadOnlyCollection<T> class.

重载

SynchronizedReadOnlyCollection<T>()

初始化 SynchronizedReadOnlyCollection<T> 类的新实例。Initializes a new instance of the SynchronizedReadOnlyCollection<T> class.

SynchronizedReadOnlyCollection<T>(Object)

使用对线程安全只读集合的访问进行同步的对象,初始化 SynchronizedReadOnlyCollection<T> 类的新实例。Initializes a new instance of the SynchronizedReadOnlyCollection<T> class with the object used to synchronize access to the thread-safe, read-only collection.

SynchronizedReadOnlyCollection<T>(Object, List<T>, Boolean)
SynchronizedReadOnlyCollection<T>(Object, IEnumerable<T>)

使用指定的可枚举元素列表和用于对线程安全的只读集合的访问进行同步的对象来初始化 SynchronizedReadOnlyCollection<T> 类的新实例。Initializes a new instance of the SynchronizedReadOnlyCollection<T> class from a specified enumerable list of elements and with the object used to synchronize access to the thread-safe, read-only collection.

SynchronizedReadOnlyCollection<T>(Object, T[])

使用指定的元素数组和用于对线程安全只读集合的访问进行同步的对象,初始化 SynchronizedReadOnlyCollection<T> 类的新实例。Initializes a new instance of the SynchronizedReadOnlyCollection<T> class from a specified array of elements and with the object used to synchronize access to the thread-safe, read-only collection.

SynchronizedReadOnlyCollection<T>()

初始化 SynchronizedReadOnlyCollection<T> 类的新实例。Initializes a new instance of the SynchronizedReadOnlyCollection<T> class.

public:
 SynchronizedReadOnlyCollection();
public SynchronizedReadOnlyCollection ();
Public Sub New ()

SynchronizedReadOnlyCollection<T>(Object)

使用对线程安全只读集合的访问进行同步的对象,初始化 SynchronizedReadOnlyCollection<T> 类的新实例。Initializes a new instance of the SynchronizedReadOnlyCollection<T> class with the object used to synchronize access to the thread-safe, read-only collection.

public:
 SynchronizedReadOnlyCollection(System::Object ^ sync_root);
public SynchronizedReadOnlyCollection (object sync_root);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (sync_root As Object)

参数

syncRoot
Object

用于对线程安全只读集合的访问进行同步的对象。The object used to synchronize access to the thread-safe, read-only collection.

异常

syncRootnullsyncRoot is null.

注解

如果使用相同 SynchronizedReadOnlyCollection<T> 创建 syncRoot 的多个实例,则所有实例之间的访问都是受保护的。If multiple instances of the SynchronizedReadOnlyCollection<T> are created using the same syncRoot, then access is protected across all instances.

SynchronizedReadOnlyCollection<T>(Object, List<T>, Boolean)

public:
 SynchronizedReadOnlyCollection(System::Object ^ sync_root, System::Collections::Generic::List<T> ^ list, bool make_copy);
public SynchronizedReadOnlyCollection (object sync_root, System.Collections.Generic.List<T> list, bool make_copy);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj * System.Collections.Generic.List<'T> * bool -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (sync_root As Object, list As List(Of T), make_copy As Boolean)

参数

sync_root
Object
list
List<T>
make_copy
Boolean

SynchronizedReadOnlyCollection<T>(Object, IEnumerable<T>)

使用指定的可枚举元素列表和用于对线程安全的只读集合的访问进行同步的对象来初始化 SynchronizedReadOnlyCollection<T> 类的新实例。Initializes a new instance of the SynchronizedReadOnlyCollection<T> class from a specified enumerable list of elements and with the object used to synchronize access to the thread-safe, read-only collection.

public:
 SynchronizedReadOnlyCollection(System::Object ^ sync_root, System::Collections::Generic::IEnumerable<T> ^ list);
public SynchronizedReadOnlyCollection (object sync_root, System.Collections.Generic.IEnumerable<T> list);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj * seq<'T> -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (sync_root As Object, list As IEnumerable(Of T))

参数

syncRoot
Object

用于对线程安全只读集合的访问进行同步的对象。The object used to synchronize access to the thread-safe, read-only collection.

list
IEnumerable<T>

元素的 IEnumerable<T> 集合,用于初始化线程安全只读集合。The IEnumerable<T> collection of elements used to initialize the thread-safe, read-only collection.

异常

syncRootlistnullsyncRoot or list is null.

SynchronizedReadOnlyCollection<T>(Object, T[])

使用指定的元素数组和用于对线程安全只读集合的访问进行同步的对象,初始化 SynchronizedReadOnlyCollection<T> 类的新实例。Initializes a new instance of the SynchronizedReadOnlyCollection<T> class from a specified array of elements and with the object used to synchronize access to the thread-safe, read-only collection.

public:
 SynchronizedReadOnlyCollection(System::Object ^ sync_root, ... cli::array <T> ^ list);
public SynchronizedReadOnlyCollection (object sync_root, params T[] list);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj * 'T[] -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (sync_root As Object, ParamArray list As T())

参数

syncRoot
Object

用于对线程安全只读集合的访问进行同步的对象。The object used to synchronize access to the thread-safe, read-only collection.

list
T[]

类型 T 元素的 Array,用于初始化线程安全只读集合。The Array of type T elements used to initialize the thread-safe, read-only collection.

异常

syncRootlistnullsyncRoot or list is null.

适用于