SynchronizedReadOnlyCollection<T> Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class.
Overloads
SynchronizedReadOnlyCollection<T>() |
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class. |
SynchronizedReadOnlyCollection<T>(Object) |
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, IEnumerable<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[]) |
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>()
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class.
public:
SynchronizedReadOnlyCollection();
public SynchronizedReadOnlyCollection ();
Public Sub New ()
Applies to
SynchronizedReadOnlyCollection<T>(Object)
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 ^ syncRoot);
public SynchronizedReadOnlyCollection (object syncRoot);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (syncRoot As Object)
Parameters
- syncRoot
- Object
The object used to synchronize access to the thread-safe, read-only collection.
Exceptions
syncRoot
is null
.
Remarks
If multiple instances of the SynchronizedReadOnlyCollection<T> are created using the same syncRoot
, then access is protected across all instances.
Applies to
SynchronizedReadOnlyCollection<T>(Object, IEnumerable<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 ^ syncRoot, System::Collections::Generic::IEnumerable<T> ^ list);
public SynchronizedReadOnlyCollection (object syncRoot, System.Collections.Generic.IEnumerable<T> list);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj * seq<'T> -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (syncRoot As Object, list As IEnumerable(Of T))
Parameters
- syncRoot
- Object
The object used to synchronize access to the thread-safe, read-only collection.
- list
- IEnumerable<T>
The IEnumerable<T> collection of elements used to initialize the thread-safe, read-only collection.
Exceptions
syncRoot
or list
is null
.
Applies to
SynchronizedReadOnlyCollection<T>(Object, 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 ^ syncRoot, ... cli::array <T> ^ list);
public SynchronizedReadOnlyCollection (object syncRoot, params T[] list);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj * 'T[] -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (syncRoot As Object, ParamArray list As T())
Parameters
- syncRoot
- Object
The object used to synchronize access to the thread-safe, read-only collection.
- list
- T[]
The Array of type T
elements used to initialize the thread-safe, read-only collection.
Exceptions
syncRoot
or list
is null
.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈